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)); -- 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