Re: [patch] hid: check for kmalloc() failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Montag, den 24.01.2011, 21:32 +0300 schrieb Dan Carpenter:
> Return -ENOMEM if kmalloc() fails.
> 
> Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
> 
> diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c
> index 1608c8d..c27bc91 100644
> --- a/drivers/hid/hid-roccat-koneplus.c
> +++ b/drivers/hid/hid-roccat-koneplus.c
> @@ -220,6 +220,10 @@ static int koneplus_get_startup_profile(struct usb_device *usb_dev)
>  	int retval;
>  
>  	buf = kmalloc(sizeof(struct koneplus_startup_profile), GFP_KERNEL);
> +	if (!buf) {
> +		retval = -ENOMEM;
> +		goto out;
> +	}
>  
>  	retval = koneplus_receive(usb_dev, KONEPLUS_USB_COMMAND_STARTUP_PROFILE,
>  			buf, sizeof(struct koneplus_startup_profile));

That was already fixed by Vasiliy Kulikov. The patch was applied to the
roccat branch in Jiri Kosinas hid repository
(dacfecdbf3a0a5072984ff8b3c224a48c8461008).
Thank you anyway.
Stefan

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


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux