[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1450831014-120487-3-git-send-email-Valdis.Kletnieks@vt.edu>
Date: Tue, 22 Dec 2015 19:36:50 -0500
From: Valdis Kletnieks <Valdis.Kletnieks@...edu>
To: gregkh@...uxfoundation.org, oleg.drokin@...el.com,
andreas.dilger@...el.com
Cc: devel@...verdev.osuosl.org, lustre-devel@...ts.lustre.org,
linux-kernel@...r.kernel.org,
Valdis Kletnieks <Valdis.Kletnieks@...edu>
Subject: [PATCH v3 2/6] 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: Valdis Kletnieks <Valdis.Kletnieks@...edu>
---
drivers/staging/lustre/lustre/fid/lproc_fid.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c b/drivers/staging/lustre/lustre/fid/lproc_fid.c
index ce90c1c54a63..eff011f30fa5 100644
--- a/drivers/staging/lustre/lustre/fid/lproc_fid.c
+++ b/drivers/staging/lustre/lustre/fid/lproc_fid.c
@@ -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;
--
2.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists