lkml.org 
[lkml]   [2018]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] HID: apple: Delete an error message for a failed memory allocation in apple_probe()
Date
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Feb 2018 20:06:53 +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-apple.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c
index 25b7bd56ae11..d739dd3aa622 100644
--- a/drivers/hid/hid-apple.c
+++ b/drivers/hid/hid-apple.c
@@ -374,10 +374,8 @@ static int apple_probe(struct hid_device *hdev,
int ret;

asc = devm_kzalloc(&hdev->dev, sizeof(*asc), GFP_KERNEL);
- if (asc == NULL) {
- hid_err(hdev, "can't alloc apple descriptor\n");
+ if (!asc)
return -ENOMEM;
- }

asc->quirks = quirks;

--
2.16.1
\
 
 \ /
  Last update: 2018-02-06 20:36    [W:0.066 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site