RE: [PATCH] usb: gadget: storage: release superspeed descriptors.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Michal,
Do you mean " if (gadget_is_superspeed(fsg->common->gadget))" is not necessary?

Regards,
Yu

-----Original Message-----
From: Michał Nazarewicz [mailto:mnazarewicz@xxxxxxxxx] On Behalf Of Michal Nazarewicz
Sent: 2011年12月9日 18:23
To: balbi@xxxxxx; linux-usb@xxxxxxxxxxxxxxx; Yu Xu
Subject: Re: [PATCH] usb: gadget: storage: release superspeed descriptors.

On Fri, 09 Dec 2011 09:52:36 +0100, Yu Xu <yuxu@xxxxxxxxxxx> wrote:
> Release superspeed mass storage descriptors memory
> when the function is unbind.
>
> Change-Id: Iffc278621266bf82abee38675494338351c0978e
> Signed-off-by: Yu Xu <yuxu@xxxxxxxxxxx>

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

Thanks!

> ---
>  drivers/usb/gadget/f_mass_storage.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
> index a18ebee..987ec79 100644
> --- a/drivers/usb/gadget/f_mass_storage.c
> +++ b/drivers/usb/gadget/f_mass_storage.c
> @@ -2987,6 +2987,9 @@ static void fsg_unbind(struct usb_configuration *c, struct usb_function *f)
>  	fsg_common_put(common);
>  	usb_free_descriptors(fsg->function.descriptors);
>  	usb_free_descriptors(fsg->function.hs_descriptors);
> +	if (gadget_is_superspeed(fsg->common->gadget))

I'd do without this if though.  After all, we don't have a condition one
line above.

> +		usb_free_descriptors(fsg->function.ss_descriptors);
> +

And without this new empty line. ;)

>  	kfree(fsg);
>  }

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--
��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux