diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2013-09-27 06:28:54 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-10-01 10:04:22 -0400 |
commit | 8854894c040cd68b463dccf267308250b336df40 (patch) | |
tree | 856081a87ef56d5aac17b244939a68afe585a6fb /drivers/usb/gadget | |
parent | 4fc4b274f9b3b5f18896a069e5f9f8dd8f0d450a (diff) |
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>
Diffstat (limited to 'drivers/usb/gadget')
-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 1a66c5baa0d1..0da66bacb0d4 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, | |||
2264 | data->raw_descs + ret, | 2264 | data->raw_descs + ret, |
2265 | (sizeof data->raw_descs) - ret, | 2265 | (sizeof data->raw_descs) - ret, |
2266 | __ffs_func_bind_do_descs, func); | 2266 | __ffs_func_bind_do_descs, func); |
2267 | if (unlikely(ret < 0)) | ||
2268 | goto error; | ||
2267 | } | 2269 | } |
2268 | 2270 | ||
2269 | /* | 2271 | /* |