Re: [PATCH 1/2] usb: composite: Fix bug: should test set_alt function pointer before use it

From: David Brownell
Date: Sat Jan 24 2009 - 00:59:32 EST


On Wednesday 07 January 2009, Bryan Wu wrote:
> Signed-off-by: Bryan Wu <cooloney@xxxxxxxxxx>

Include a real patch comment -- "test the *correct* function
pointer" would suffice, and:

Acked-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>


> ---
> drivers/usb/gadget/composite.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index f2da026..363951e 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;
> --
> 1.5.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/