HID: Roccat: Delete an error message for a failed memory allocation in nine functions
Subsystems (3)
PATCH 1/1 HID: Roccat: Delete an error message for a failed memory allocation in nine functions
From: Markus Elfring <[email protected]>
Date: Sat, 3 Feb 2018 11:45:15 +0100
Omit an extra message for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/hid/hid-roccat-arvo.c | 5 ++--- drivers/hid/hid-roccat-isku.c | 5 ++--- drivers/hid/hid-roccat-koneplus.c | 5 ++--- drivers/hid/hid-roccat-konepure.c | 5 ++--- drivers/hid/hid-roccat-kovaplus.c | 5 ++--- drivers/hid/hid-roccat-lua.c | 5 ++--- drivers/hid/hid-roccat-pyra.c | 5 ++--- drivers/hid/hid-roccat-ryos.c | 5 ++--- drivers/hid/hid-roccat-savu.c | 5 ++--- 9 files changed, 18 insertions(+), 27 deletions(-)
drivers/hid/hid-roccat-arvo.c +2 -3
@@ -300,10 +300,9 @@ static int arvo_init_specials(struct hid_device *hdev) } arvo =kzalloc (sizeof (*arvo),GFP_KERNEL ); -if (!arvo) { -hid_err (hdev,"can't alloc device descriptor\n" ); +if (!arvo)return -ENOMEM ; - } +hid_set_drvdata (hdev, arvo); retval =arvo_init_arvo_device_struct (usb_dev, arvo);
drivers/hid/hid-roccat-isku.c +2 -3
@@ -280,10 +280,9 @@ static int isku_init_specials(struct hid_device *hdev) } isku =kzalloc (sizeof (*isku),GFP_KERNEL ); -if (!isku) { -hid_err (hdev,"can't alloc device descriptor\n" ); +if (!isku)return -ENOMEM ; - } +hid_set_drvdata (hdev, isku); retval =isku_init_isku_device_struct (usb_dev, isku);
drivers/hid/hid-roccat-koneplus.c +2 -3
@@ -385,10 +385,9 @@ static int koneplus_init_specials(struct hid_device *hdev) = USB_INTERFACE_PROTOCOL_MOUSE) { koneplus =kzalloc (sizeof (*koneplus),GFP_KERNEL ); -if (!koneplus) { -hid_err (hdev,"can't alloc device descriptor\n" ); +if (!koneplus)return -ENOMEM ; - } +hid_set_drvdata (hdev, koneplus); retval =koneplus_init_koneplus_device_struct (usb_dev, koneplus);
drivers/hid/hid-roccat-konepure.c +2 -3
@@ -89,10 +89,9 @@ static int konepure_init_specials(struct hid_device *hdev) } konepure =kzalloc (sizeof (*konepure),GFP_KERNEL ); -if (!konepure) { -hid_err (hdev,"can't alloc device descriptor\n" ); +if (!konepure)return -ENOMEM ; - } +hid_set_drvdata (hdev, konepure); retval =roccat_common2_device_init_struct (usb_dev, konepure);
drivers/hid/hid-roccat-kovaplus.c +2 -3
@@ -452,10 +452,9 @@ static int kovaplus_init_specials(struct hid_device *hdev) = USB_INTERFACE_PROTOCOL_MOUSE) { kovaplus =kzalloc (sizeof (*kovaplus),GFP_KERNEL ); -if (!kovaplus) { -hid_err (hdev,"can't alloc device descriptor\n" ); +if (!kovaplus)return -ENOMEM ; - } +hid_set_drvdata (hdev, kovaplus); retval =kovaplus_init_kovaplus_device_struct (usb_dev, kovaplus);
drivers/hid/hid-roccat-lua.c +2 -3
@@ -123,10 +123,9 @@ static int lua_init_specials(struct hid_device *hdev)int retval; lua =kzalloc (sizeof (*lua),GFP_KERNEL ); -if (!lua) { -hid_err (hdev,"can't alloc device descriptor\n" ); +if (!lua)return -ENOMEM ; - } +hid_set_drvdata (hdev, lua); retval =lua_init_lua_device_struct (usb_dev, lua);
drivers/hid/hid-roccat-pyra.c +2 -3
@@ -404,10 +404,9 @@ static int pyra_init_specials(struct hid_device *hdev) = USB_INTERFACE_PROTOCOL_MOUSE) { pyra =kzalloc (sizeof (*pyra),GFP_KERNEL ); -if (!pyra) { -hid_err (hdev,"can't alloc device descriptor\n" ); +if (!pyra)return -ENOMEM ; - } +hid_set_drvdata (hdev, pyra); retval =pyra_init_pyra_device_struct (usb_dev, pyra);
drivers/hid/hid-roccat-ryos.c +2 -3
@@ -97,10 +97,9 @@ static int ryos_init_specials(struct hid_device *hdev) } ryos =kzalloc (sizeof (*ryos),GFP_KERNEL ); -if (!ryos) { -hid_err (hdev,"can't alloc device descriptor\n" ); +if (!ryos)return -ENOMEM ; - } +hid_set_drvdata (hdev, ryos); retval =roccat_common2_device_init_struct (usb_dev, ryos);
drivers/hid/hid-roccat-savu.c +2 -3
@@ -69,10 +69,9 @@ static int savu_init_specials(struct hid_device *hdev) } savu =kzalloc (sizeof (*savu),GFP_KERNEL ); -if (!savu) { -hid_err (hdev,"can't alloc device descriptor\n" ); +if (!savu)return -ENOMEM ; - } +hid_set_drvdata (hdev, savu); retval =roccat_common2_device_init_struct (usb_dev, savu);
Signature · 1 line
2.16.1