lkml.org 
[lkml]   [2018]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 3/3] hid-lg4ff: Delete an error message for a failed memory allocation in lg4ff_init()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Feb 2018 15:26:06 +0100

Omit an extra message for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/hid/hid-lg4ff.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c
index 512d67e1aae3..ec6b94bb3fd8 100644
--- a/drivers/hid/hid-lg4ff.c
+++ b/drivers/hid/hid-lg4ff.c
@@ -1401,10 +1401,8 @@ int lg4ff_init(struct hid_device *hid)

for (j = 0; j < 5; j++) {
led = kzalloc(sizeof(struct led_classdev)+name_sz, GFP_KERNEL);
- if (!led) {
- hid_err(hid, "can't allocate memory for LED %d\n", j);
+ if (!led)
goto err_leds;
- }

name = (void *)(&led[1]);
snprintf(name, name_sz, "%s::RPM%d", dev_name(&hid->dev), j+1);
--
2.16.1
\
 
 \ /
  Last update: 2018-02-06 15:47    [W:0.025 / U:1.100 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site