* [PATCH v2] USB: gadget: f_fs: fix error handling
@ 2013-09-30 9:41 Robert Baldyga
2013-09-30 11:50 ` Michal Nazarewicz
0 siblings, 1 reply; 3+ messages in thread
From: Robert Baldyga @ 2013-09-30 9:41 UTC (permalink / raw)
To: balbi
Cc: gregkh, linux-usb, linux-kernel, b.zolnierkie, m.szyprowski,
andrzej.p, mina86, Robert Baldyga
Hello,
This is update for my patch fixing error handling in functionfs module.
I have fixed typos from previous version, and changed description for greater
clearity as Sergei Shtylyov suggested.
This patch add missing error check in ffs_func_bind() function, after
ffs_do_descs() function call for high speed descriptors. Without this check
it's possible that the module will try to dereference incorrect pointer.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Changelog:
v2:
- fix typos
- expand patch desctiprion
v1: https://lkml.org/lkml/2013/9/27/128
---
drivers/usb/gadget/f_fs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index 1a66c5b..0da66ba 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -2264,6 +2264,8 @@ 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;
}
/*
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] USB: gadget: f_fs: fix error handling
2013-09-30 9:41 [PATCH v2] USB: gadget: f_fs: fix error handling Robert Baldyga
@ 2013-09-30 11:50 ` Michal Nazarewicz
2013-10-01 13:58 ` Felipe Balbi
0 siblings, 1 reply; 3+ messages in thread
From: Michal Nazarewicz @ 2013-09-30 11:50 UTC (permalink / raw)
To: Robert Baldyga, balbi
Cc: gregkh, linux-usb, linux-kernel, b.zolnierkie, m.szyprowski,
andrzej.p, Robert Baldyga
[-- Attachment #1: Type: text/plain, Size: 1723 bytes --]
On Mon, Sep 30 2013, Robert Baldyga wrote:
> Hello,
>
> This is update for my patch fixing error handling in functionfs module.
> I have fixed typos from previous version, and changed description for greater
> clearity as Sergei Shtylyov suggested.
>
> This patch add missing error check in ffs_func_bind() function, after
> ffs_do_descs() function call for high speed descriptors. Without this check
> it's possible that the module will try to dereference incorrect pointer.
>
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
> Changelog:
>
> v2:
> - fix typos
> - expand patch desctiprion
>
> v1: https://lkml.org/lkml/2013/9/27/128
> ---
Note that it's helpful for maintainers to include everything that is not
meant to go in the commit message after those three minus signs. This
way, “git am” will ignore the text.
> drivers/usb/gadget/f_fs.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
> index 1a66c5b..0da66ba 100644
> --- a/drivers/usb/gadget/f_fs.c
> +++ b/drivers/usb/gadget/f_fs.c
> @@ -2264,6 +2264,8 @@ 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;
> }
>
> /*
> --
> 1.7.9.5
>
--
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 --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] USB: gadget: f_fs: fix error handling
2013-09-30 11:50 ` Michal Nazarewicz
@ 2013-10-01 13:58 ` Felipe Balbi
0 siblings, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2013-10-01 13:58 UTC (permalink / raw)
To: Michal Nazarewicz
Cc: Robert Baldyga, balbi, gregkh, linux-usb, linux-kernel,
b.zolnierkie, m.szyprowski, andrzej.p
[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]
Hi,
On Mon, Sep 30, 2013 at 01:50:25PM +0200, Michal Nazarewicz wrote:
> On Mon, Sep 30 2013, Robert Baldyga wrote:
> > Hello,
> >
> > This is update for my patch fixing error handling in functionfs module.
> > I have fixed typos from previous version, and changed description for greater
> > clearity as Sergei Shtylyov suggested.
> >
> > This patch add missing error check in ffs_func_bind() function, after
> > ffs_do_descs() function call for high speed descriptors. Without this check
> > it's possible that the module will try to dereference incorrect pointer.
> >
> > Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
>
> Acked-by: Michal Nazarewicz <mina86@mina86.com>
>
> > Changelog:
> >
> > v2:
> > - fix typos
> > - expand patch desctiprion
> >
> > v1: https://lkml.org/lkml/2013/9/27/128
> > ---
>
> Note that it's helpful for maintainers to include everything that is not
> meant to go in the commit message after those three minus signs. This
> way, “git am” will ignore the text.
right, please resend so I don't have to manually edit. Also, while doing
that, add Michal's Acked-by to the patch.
thanks
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-01 13:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-30 9:41 [PATCH v2] USB: gadget: f_fs: fix error handling Robert Baldyga
2013-09-30 11:50 ` Michal Nazarewicz
2013-10-01 13:58 ` Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox