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 1/3] hid-lg: Delete an error message for a failed memory allocation in lg_probe()
From
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Feb 2018 14:25:32 +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-lg.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c
index 596227ddb6e0..f4439dc64497 100644
--- a/drivers/hid/hid-lg.c
+++ b/drivers/hid/hid-lg.c
@@ -728,10 +728,9 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
}

drv_data = kzalloc(sizeof(struct lg_drv_data), GFP_KERNEL);
- if (!drv_data) {
- hid_err(hdev, "Insufficient memory, cannot allocate driver data\n");
+ if (!drv_data)
return -ENOMEM;
- }
+
drv_data->quirks = id->driver_data;

hid_set_drvdata(hdev, (void *)drv_data);
--
2.16.1
\
 
 \ /
  Last update: 2018-02-06 15:45    [W:0.028 / U:2.172 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site