Skip to content

Commit 8854894

Browse files
Robert BaldygaFelipe Balbi
authored andcommitted
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. [ [email protected] : removed trailing empty line ] Acked-by: Michal Nazarewicz <[email protected]> Signed-off-by: Robert Baldyga <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 4fc4b27 commit 8854894

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/usb/gadget/f_fs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,6 +2264,8 @@ static int ffs_func_bind(struct usb_configuration *c,
22642264
data->raw_descs + ret,
22652265
(sizeof data->raw_descs) - ret,
22662266
__ffs_func_bind_do_descs, func);
2267+
if (unlikely(ret < 0))
2268+
goto error;
22672269
}
22682270

22692271
/*

0 commit comments

Comments
 (0)