Commit 27a1a1e2 authored by Carlos Santa's avatar Carlos Santa Committed by Rodrigo Vivi

drm/xe: stringify the argument to avoid potential vulnerability

This error gets printed inside a sandbox with warnings turned on.

/mnt/host/source/src/third_party/kernel/v5.15/drivers/
gpu/drm/xe/xe_gt_idle_sysfs.c:87:26: error: format string is
not a string literal (potentially insecure) [-Werror,-Wformat-security]
        return sysfs_emit(buff, gtidle->name);
                                ^~~~~~~~~~~~
/mnt/host/source/src/third_party/kernel/v5.15/drivers/
gpu/drm/xe/xe_gt_idle_sysfs.c:87:26: note: treat the string
as an argument to avoid this
        return sysfs_emit(buff, gtidle->name);
                                ^
                                "%s",
1 error generated.

CC: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarCarlos Santa <carlos.santa@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 5d30cfe0
...@@ -85,7 +85,7 @@ static ssize_t name_show(struct device *dev, ...@@ -85,7 +85,7 @@ static ssize_t name_show(struct device *dev,
{ {
struct xe_gt_idle *gtidle = dev_to_gtidle(dev); struct xe_gt_idle *gtidle = dev_to_gtidle(dev);
return sysfs_emit(buff, gtidle->name); return sysfs_emit(buff, "%s\n", gtidle->name);
} }
static DEVICE_ATTR_RO(name); static DEVICE_ATTR_RO(name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment