lkml.org 
[lkml]   [2011]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] usb: gadget: f_mass_storage: Remove the LUN check which is always true
Date
From
On Wed, 04 May 2011 17:04:03 +0200, Maxin John <maxin.john@gmail.com>  
wrote:

> Hi Michal,
>
>> Acked-by: Michal Nazarewicz <mina86@mina86.com>
>
> Thank you very much for reviewing the patch.
>
>> file_storage.c has the same check, could you remove it as well.
>
> Please find the patch for "file_storage.c" below. Should I merge these
> two patches and re-submit as a single one?

I would merge them together.

> Signed-off-by: Maxin B. John <maxin.john@gmail.com>
> ---
> diff --git a/drivers/usb/gadget/file_storage.c
> b/drivers/usb/gadget/file_storage.c
> index a6eacb5..a9c5177 100644
> --- a/drivers/usb/gadget/file_storage.c
> +++ b/drivers/usb/gadget/file_storage.c
> @@ -2314,7 +2314,7 @@ static int check_command(struct fsg_dev *fsg,
> int cmnd_size,
> fsg->lun = lun; // Use LUN from the command
>
> /* Check the LUN */
> - if (fsg->lun >= 0 && fsg->lun < fsg->nluns) {
> + if (fsg->lun < fsg->nluns) {
> fsg->curlun = curlun = &fsg->luns[fsg->lun];
> if (fsg->cmnd[0] != REQUEST_SENSE) {
> curlun->sense_data = SS_NO_SENSE;


--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +-----<email/xmpp: mnazarewicz@google.com>-----ooO--(_)--Ooo--


\
 
 \ /
  Last update: 2011-05-04 17:45    [W:0.138 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site