Commit 382b6ea
usb: gadget: f_fs: restore ffs_func_disable() functionality
The blamed commit made ffs_func_disable() always return -EINVAL as the
method calls ffs_func_set_alt() with the ``alt`` argument being
``(unsigned)-1``, which is always greater than MAX_ALT_SETTINGS.
Use the MAX_ALT_SETTINGS check just in the f->set_alt() code path,
f->disable() doesn't care about the ``alt`` parameter.
Make a surgical fix, but really the f->disable() code shall be pulled
out from ffs_func_set_alt(), the code will become clearer. A patch will
follow.
Note that ffs_func_disable() always returning -EINVAL made pixel6 crash
on USB disconnect.
Fixes: 2f55055 ("usb: gadget: f_fs: Add the missing get_alt callback")
Cc: stable <[email protected]>
Reported-by: William McVicker <[email protected]>
Signed-off-by: Tudor Ambarus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 7d5cbd7 commit 382b6ea
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3731 | 3731 | | |
3732 | 3732 | | |
3733 | 3733 | | |
3734 | | - | |
3735 | | - | |
3736 | | - | |
3737 | 3734 | | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
3738 | 3738 | | |
3739 | 3739 | | |
3740 | 3740 | | |
| |||
0 commit comments