[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTik9e5it5vTMxvFUnZGpoO8N0ida8Q@mail.gmail.com>
Date: Wed, 4 May 2011 15:16:05 +0100
From: Maxin John <maxin.john@...il.com>
To: m.nazarewicz@...sung.com
Cc: gregkh@...e.de, stern@...land.harvard.edu, mina86@...a86.com,
m-sonasath@...com, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, roger.quadros@...ia.com
Subject: [PATCH] usb: gadget: f_mass_storage: Remove the LUN check which is
always true
Hi,
Since comparing an unsigned int (common->lun) greater than or equal
to zero is always true, I think it is safe to remove this check.
Please let me know your comments.
Thanks to Coverity for pointing this out.
Signed-off-by: Maxin B. John <maxin.john@...il.com>
---
diff --git a/drivers/usb/gadget/f_mass_storage.c
b/drivers/usb/gadget/f_mass_storage.c
index 6d8e533..cade79e 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -1910,7 +1910,7 @@ static int check_command(struct fsg_common
*common, int cmnd_size,
common->lun, lun);
/* Check the LUN */
- if (common->lun >= 0 && common->lun < common->nluns) {
+ if (common->lun < common->nluns) {
curlun = &common->luns[common->lun];
common->curlun = curlun;
if (common->cmnd[0] != REQUEST_SENSE) {
--
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