KCSAN updates for v6.2
cover KCSAN updates for v6.2
Hello!
This series provide a KCSAN update:
1. Use min() to fix Coccinelle warning, courtesy of Thorsten Blum.
Thanx, Paul
------------------------------------------------------------------------
debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
PATCH 1/1 kcsan: Use min() to fix Coccinelle warning
From: Thorsten Blum <[email protected]>
Fixes the following Coccinelle/coccicheck warning reported by minmax.cocci:
WARNING opportunity for min()
Use const size_t instead of int for the result of min().
Compile-tested with CONFIG_KCSAN=y.
Reviewed-by Marco Elver <[email protected]>
Signed-off-by Thorsten Blum <[email protected]>
Signed-off-by Paul E. McKenney <[email protected]>
--- kernel/kcsan/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/kcsan/debugfs.c +1 -1
@@ -225,7 +225,7 @@ debugfs_write(struct file *file, const char __user *buf, size_t count, loff_t *o {char kbuf[KSYM_NAME_LEN ];char *arg; -int read_len = count < (sizeof (kbuf) -1 ) ? count : (sizeof (kbuf) -1 ); +const size_t read_len =min (count,sizeof (kbuf) -1 );if (copy_from_user (kbuf, buf, read_len))return -EFAULT ;
Signature · 1 line
2.40.1