Skip to content

Commit

Permalink
drivers/staging/lustre: Fix set-but-unused whinge.
Browse files Browse the repository at this point in the history
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: Valdis Kletnieks <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
valdisk authored and gregkh committed Feb 3, 2016
1 parent b8947b3 commit f65a092
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/lustre/lustre/fid/lproc_fid.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ ldebugfs_fid_write_common(const char __user *buffer, size_t count,
rc = sscanf(kernbuf, "[%llx - %llx]\n",
(unsigned long long *)&tmp.lsr_start,
(unsigned long long *)&tmp.lsr_end);
if (rc != 2)
return -EINVAL;
if (!range_is_sane(&tmp) || range_is_zero(&tmp) ||
tmp.lsr_start < range->lsr_start || tmp.lsr_end > range->lsr_end)
return -EINVAL;
Expand Down

0 comments on commit f65a092

Please sign in to comment.