All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Nazarewicz <mina86@mina86.com>
To: Robert Baldyga <r.baldyga@samsung.com>, balbi@ti.com
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com,
	m.szyprowski@samsung.com, andrzej.p@samsung.com,
	Robert Baldyga <r.baldyga@samsung.com>
Subject: Re: [PATCH] USB: gadget: f_fs: fix error handling
Date: Fri, 27 Sep 2013 16:05:03 +0200	[thread overview]
Message-ID: <xa1thad6xsvk.fsf@mina86.com> (raw)
In-Reply-To: <1380277734-17590-1-git-send-email-r.baldyga@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]

On Fri, Sep 27 2013, Robert Baldyga wrote:
> This patch add missing error check in ffs_func_bind() function, after
> ffs_do_descs() funcion call for hs descriptors. Without this check it's
> possible that the module will try dereference incorrect pointer.
>
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>

Acked-by: Michal Nazarewicz <mina86@mina86.com>

> ---
>  drivers/usb/gadget/f_fs.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
> index 1a66c5b..fe7d532 100644
> --- a/drivers/usb/gadget/f_fs.c
> +++ b/drivers/usb/gadget/f_fs.c
> @@ -2264,7 +2264,10 @@ static int ffs_func_bind(struct usb_configuration *c,
>  				   data->raw_descs + ret,
>  				   (sizeof data->raw_descs) - ret,
>  				   __ffs_func_bind_do_descs, func);
> +		if (unlikely(ret < 0))
> +			goto error;
>  	}
> +	

This new line with only a tab in it is not needed here though.

>  
>  	/*
>  	 * Now handle interface numbers allocation and interface and

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--

[-- Attachment #2.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2013-09-27 14:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 10:28 [PATCH] USB: gadget: f_fs: fix error handling Robert Baldyga
2013-09-27 14:05 ` Michal Nazarewicz [this message]
2013-09-27 18:20 ` Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xa1thad6xsvk.fsf@mina86.com \
    --to=mina86@mina86.com \
    --cc=andrzej.p@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=r.baldyga@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.