diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2013-09-27 12:28:54 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@debian.org> | 2013-10-12 23:15:02 +0200 |
commit | 8f7c94b42d7e9e1ec5e25243130ae7bb3b046a5c (patch) | |
tree | cac776bf15d0a27cb8fe44afd03f35ae9bd14617 | |
parent | c338ddd09d3f949097f9d34d50f88229ef8e7d88 (diff) | |
download | linux-8f7c94b42d7e9e1ec5e25243130ae7bb3b046a5c.tar.bz2 |
usb: gadget: f_fs: fix error handling
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 dereference incorrect
pointer.
[ balbi@ti.com : removed trailing empty line ]
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/gadget/f_fs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index 0658908d8968..44cf775a8627 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c @@ -2256,6 +2256,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; } /* |