* [android-common:android-mainline-tracking 200/707] drivers/pwm/sysfs.c:238:8-16: WARNING: use scnprintf or sprintf
@ 2020-11-24 3:29 kernel test robot
2020-11-24 3:29 ` [PATCH] BACKPORT: FROMLIST: pwm: fix device_attr_show.cocci warnings kernel test robot
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-11-24 3:29 UTC (permalink / raw
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 974 bytes --]
CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com
tree: https://android.googlesource.com/kernel/common android-mainline-tracking
head: a73b3179409cc1b4eeb564ba50cef20e08d145c4
commit: df261e8006bc5a471772a7dbb2a7d398b1fd8f26 [200/707] BACKPORT: FROMLIST: pwm: Add support for different PWM output types
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
config: x86_64-randconfig-c002-20201123 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 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/pwm/sysfs.c:238: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: 37211 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] BACKPORT: FROMLIST: pwm: fix device_attr_show.cocci warnings
2020-11-24 3:29 [android-common:android-mainline-tracking 200/707] drivers/pwm/sysfs.c:238:8-16: WARNING: use scnprintf or sprintf kernel test robot
@ 2020-11-24 3:29 ` kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-11-24 3:29 UTC (permalink / raw
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 1510 bytes --]
CC: kbuild-all(a)lists.01.org
TO: cros-kernel-buildreports(a)googlegroups.com
From: kernel test robot <lkp@intel.com>
drivers/pwm/sysfs.c:238:8-16: WARNING: use scnprintf or sprintf
From Documentation/filesystems/sysfs.rst:
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: df261e8006bc ("BACKPORT: FROMLIST: pwm: Add support for different PWM output types")
CC: Fenglin Wu <fenglinw@codeaurora.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://android.googlesource.com/kernel/common android-mainline-tracking
head: a73b3179409cc1b4eeb564ba50cef20e08d145c4
commit: df261e8006bc5a471772a7dbb2a7d398b1fd8f26 [200/707] BACKPORT: FROMLIST: pwm: Add support for different PWM output types
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
Please take the patch only if it's a positive warning. Thanks!
sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/pwm/sysfs.c
+++ b/drivers/pwm/sysfs.c
@@ -235,7 +235,7 @@ static ssize_t output_type_show(struct d
break;
}
- return snprintf(buf, PAGE_SIZE, "%s\n", output_type);
+ return scnprintf(buf, PAGE_SIZE, "%s\n", output_type);
}
static DEVICE_ATTR_RW(period);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-24 3:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-24 3:29 [android-common:android-mainline-tracking 200/707] drivers/pwm/sysfs.c:238:8-16: WARNING: use scnprintf or sprintf kernel test robot
2020-11-24 3:29 ` [PATCH] BACKPORT: FROMLIST: pwm: 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.