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: d7e09d0397 ("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>
This commit is contained in:
Dan Carpenter 2018-01-22 13:26:14 +03:00 committed by Greg Kroah-Hartman
parent a81200b5ac
commit 134aecbc25
1 changed files with 1 additions and 1 deletions

View File

@ -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;