From: Bryan Wu Date: Wed, 7 Jan 2009 16:21:18 +0000 (+0800) Subject: USB: composite: Fix bug: should test set_alt function pointer before use it X-Git-Tag: v2.6.29-rc3~6^2~20 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=dd4dff8b035f6dda69ece98e20d4c2d76b9f97d1;p=linux-2.6-omap-h63xx.git USB: composite: Fix bug: should test set_alt function pointer before use it Signed-off-by: Bryan Wu Acked-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index f2da0269e1b..363951eb333 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -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;