diff options
author | Thorsten Blum <thorsten.blum@linux.dev> | 2025-02-14 12:43:02 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2025-02-18 21:34:08 -0500 |
commit | d69ddae194ca2c8ea426747efba730bfec20fe04 (patch) | |
tree | ad5eda5c8d544e6e4bf1acbd2a8714b46228899c /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 583e518e7100362e3937b583976f9470c39d1db2 (diff) |
scsi: hpsa: Remove deprecated and unnecessary strncpy()
While replacing strncpy() with strscpy(), Bart Van Assche pointed out
that the code occurs inside sysfs write callbacks, which already uses
NUL-terminated strings. This allows the string to be passed directly to
sscanf() without requiring a temporary copy.
Remove the deprecated and unnecessary strncpy() and the corresponding
local variables, and pass the buffer buf directly to sscanf().
Replace sscanf() with kstrtoint() to silence checkpatch warnings.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Cc: Kees Cook <kees@kernel.org>
Cc: David Laight <david.laight.linux@gmail.com>
Suggested-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250214114302.86001-2-thorsten.blum@linux.dev
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions