> -----Original Message-----
> From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb-
> ow...@vger.kernel.org] On Behalf Of philippedesw...@gmail.com
> Sent: Saturday, May 24, 2014 7:29 PM
> To: philippedesw...@gmail.com; linux-usb@vger.kernel.org
> Subject: [PATCH v3 4/4] libusbg: Do not dereference usb config
> attributes when they are NULL. CID#56126
> 
> From: Philippe De Swert <philippe.desw...@jollamobile.com>
> 
> We probably need to check if we get valid attributes passed.
> Otherwise we will
> try to dereference a NULL-pointer as the usb_config_attr will not
> be valid.
> 
> Signed-off-by: Philippe De Swert <philippe.desw...@jollamobile.com>

Reviewed-by: Krzysztof Opasiak <k.opas...@samsung.com>

> ---
>  src/usbg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/usbg.c b/src/usbg.c
> index 8ad6a9e..f7bd7aa 100644
> --- a/src/usbg.c
> +++ b/src/usbg.c
> @@ -1787,7 +1787,7 @@ int usbg_set_config_attrs(usbg_config *c,
> usbg_config_attrs *c_attrs)
>  {
>       int ret = USBG_ERROR_INVALID_PARAM;
> 
> -     if (c && !c_attrs) {
> +     if (c && c_attrs) {
>               ret = usbg_write_dec(c->path, c->name, "MaxPower",
> c_attrs->bMaxPower);
>               if (ret == USBG_SUCCESS)
>                       ret = usbg_write_hex8(c->path, c->name,
> "bmAttributes",
> --
> 1.8.1.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> usb" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to