USB: composite: Fix bug: should test set_alt function pointer before use it
Signed-off-by: Bryan Wu <cooloney@kernel.org> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
cd67435ef9
commit
dd4dff8b03
1 changed files with 1 additions and 1 deletions
|
@ -772,7 +772,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
|||
f = cdev->config->interface[w_index];
|
||||
if (!f)
|
||||
break;
|
||||
if (w_value && !f->get_alt)
|
||||
if (w_value && !f->set_alt)
|
||||
break;
|
||||
value = f->set_alt(f, w_index, w_value);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue