> -----Original Message-----
> From: [email protected] [mailto:linux-usb-
> [email protected]] On Behalf Of [email protected]
> Sent: Saturday, May 24, 2014 7:29 PM
> To: [email protected]; [email protected]
> Subject: [PATCH v3 3/4] libusbg: Do not try to dereference func
> when it is NULL. CID#56127
> 
> From: Philippe De Swert <[email protected]>
> 
> We check if func is NULL, so if the allocation function failed we
> should
> not dereference or handle it anymore, so we jump straight to the
> end.
> 
> Signed-off-by: Philippe De Swert <[email protected]>

Reviewed-by: Krzysztof Opasiak <[email protected]>

> ---
>  src/usbg.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/usbg.c b/src/usbg.c
> index 66aa435..8ad6a9e 100644
> --- a/src/usbg.c
> +++ b/src/usbg.c
> @@ -1653,6 +1653,7 @@ int usbg_create_function(usbg_gadget *g,
> usbg_function_type type,
>       if (!func) {
>               ERRORNO("allocating function\n");
>               ret = USBG_ERROR_NO_MEM;
> +             goto out;
>       }
> 
>       free_space = sizeof(fpath) - n;
> --
> 1.8.1.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> usb" in
> the body of a message to [email protected]
> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to