diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-01-22 13:26:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-22 11:40:49 +0100 |
commit | 134aecbc25fd77645baaea5467b2a7ed8e9d1ea7 (patch) | |
tree | e2686cffb296e7b90ceafe4f9aa653a792377fae /drivers/staging/lustre | |
parent | a81200b5acb30460163f5b2ce393e54d6445fd5d (diff) | |
download | linux-stable-134aecbc25fd77645baaea5467b2a7ed8e9d1ea7.tar.gz linux-stable-134aecbc25fd77645baaea5467b2a7ed8e9d1ea7.tar.bz2 linux-stable-134aecbc25fd77645baaea5467b2a7ed8e9d1ea7.zip |
staging: lustre: libcfs: Prevent harmless read underflow
Because this is a post-op instead of a pre-op, then it means we check
if knl_buffer[-1] is a space. It doesn't really hurt anything, but
it causes a static checker warning so let's fix it.
Fixes: d7e09d0397e8 ("staging: add Lustre file system client support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r-- | drivers/staging/lustre/lnet/libcfs/tracefile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lnet/libcfs/tracefile.c b/drivers/staging/lustre/lnet/libcfs/tracefile.c index da2844f37edf..57913aae1d88 100644 --- a/drivers/staging/lustre/lnet/libcfs/tracefile.c +++ b/drivers/staging/lustre/lnet/libcfs/tracefile.c @@ -785,7 +785,7 @@ int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob, return -EFAULT; nob = strnlen(knl_buffer, usr_buffer_nob); - while (nob-- >= 0) /* strip trailing whitespace */ + while (--nob >= 0) /* strip trailing whitespace */ if (!isspace(knl_buffer[nob])) break; |