* [jlawall:for-5.9 1/3] drivers/scsi/pcmcia/sym53c500_cs.c:621:8-16: WARNING: use scnprintf or sprintf
@ 2020-07-07 17:07 kernel test robot
2020-07-07 17:07 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-07-07 17:07 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 983 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.9
head: 5502a4eb3af819792a6c43b418c401f613a39d02
commit: 988676da837516bbfafda5478472fd4265f0de4e [1/3] coccinelle: api: add device_attr_show script
:::::: branch date: 12 days ago
:::::: commit date: 13 days ago
config: c6x-randconfig-c024-20200707 (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> drivers/scsi/pcmcia/sym53c500_cs.c:621:8-16: WARNING: use scnprintf or sprintf
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29884 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] coccinelle: api: fix device_attr_show.cocci warnings
2020-07-07 17:07 [jlawall:for-5.9 1/3] drivers/scsi/pcmcia/sym53c500_cs.c:621:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-07-07 17:07 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-07-07 17:07 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1703 bytes --]
CC: kbuild-all(a)lists.01.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
From: kernel test robot <lkp@intel.com>
drivers/scsi/pcmcia/sym53c500_cs.c:621: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: 988676da8375 ("coccinelle: api: add device_attr_show script")
CC: Denis Efremov <efremov@linux.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.9
head: 5502a4eb3af819792a6c43b418c401f613a39d02
commit: 988676da837516bbfafda5478472fd4265f0de4e [1/3] coccinelle: api: add device_attr_show script
:::::: branch date: 12 days ago
:::::: commit date: 13 days ago
Please take the patch only if it's a positive warning. Thanks!
sym53c500_cs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -618,7 +618,7 @@ SYM53C500_show_pio(struct device *dev, s
struct sym53c500_data *data =
(struct sym53c500_data *)SHp->hostdata;
- return snprintf(buf, 4, "%d\n", data->fast_pio);
+ return scnprintf(buf, 4, "%d\n", data->fast_pio);
}
static ssize_t
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-07 17:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 17:07 [jlawall:for-5.9 1/3] drivers/scsi/pcmcia/sym53c500_cs.c:621:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-07-07 17:07 ` [PATCH] coccinelle: api: fix device_attr_show.cocci warnings kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.