CC: [email protected] CC: [email protected] TO: Denis Efremov <[email protected]> CC: Julia Lawall <[email protected]> CC: Bartlomiej Zolnierkiewicz <[email protected]> CC: Daniel Vetter <[email protected]> CC: Jani Nikula <[email protected]> CC: Arnd Bergmann <[email protected]> CC: [email protected] CC: [email protected] CC: [email protected]
From: kernel test robot <[email protected]> drivers/video/fbdev/sstfb.c:736:8-16: WARNING: use scnprintf or sprintf From Documentation/filesystems/sysfs.txt: show() must not use snprintf() when formatting the value to be returned to user space. If you can guarantee that an overflow will never happen you can use sprintf() otherwise you must use scnprintf(). Generated by: scripts/coccinelle/api/device_attr_show.cocci Fixes: abfc19ff202d ("coccinelle: api: add device_attr_show script") CC: Denis Efremov <[email protected]> Signed-off-by: kernel test robot <[email protected]> --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 18445bf405cb331117bc98427b1ba6f12418ad17 commit: abfc19ff202d287742483e15fd478ddd6ada2187 coccinelle: api: add device_attr_show script :::::: branch date: 85 minutes ago :::::: commit date: 2 weeks ago Please take the patch only if it's a positive warning. Thanks! sstfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/video/fbdev/sstfb.c +++ b/drivers/video/fbdev/sstfb.c @@ -733,7 +733,7 @@ static ssize_t show_vgapass(struct devic { struct fb_info *info = dev_get_drvdata(device); struct sstfb_par *par = info->par; - return snprintf(buf, PAGE_SIZE, "%d\n", par->vgapass); + return scnprintf(buf, PAGE_SIZE, "%d\n", par->vgapass); } static struct device_attribute device_attrs[] = { _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
