Commit f65a0922 authored by Valdis Kletnieks's avatar Valdis Kletnieks Committed by Greg Kroah-Hartman

drivers/staging/lustre: Fix set-but-unused whinge.

drivers/staging/lustre/lustre/fid/lproc_fid.c: In function 'ldebugfs_fid_write_common':
drivers/staging/lustre/lustre/fid/lproc_fid.c:67:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
  int rc;

We fix it by *using* the return code to help bulletproof it.  It says it's
test code - it should be *more* bulletproof than production, not less.
Signed-off-by: default avatarValdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b8947b39
...@@ -85,6 +85,8 @@ ldebugfs_fid_write_common(const char __user *buffer, size_t count, ...@@ -85,6 +85,8 @@ ldebugfs_fid_write_common(const char __user *buffer, size_t count,
rc = sscanf(kernbuf, "[%llx - %llx]\n", rc = sscanf(kernbuf, "[%llx - %llx]\n",
(unsigned long long *)&tmp.lsr_start, (unsigned long long *)&tmp.lsr_start,
(unsigned long long *)&tmp.lsr_end); (unsigned long long *)&tmp.lsr_end);
if (rc != 2)
return -EINVAL;
if (!range_is_sane(&tmp) || range_is_zero(&tmp) || if (!range_is_sane(&tmp) || range_is_zero(&tmp) ||
tmp.lsr_start < range->lsr_start || tmp.lsr_end > range->lsr_end) tmp.lsr_start < range->lsr_start || tmp.lsr_end > range->lsr_end)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment