Skip to contentSkip to conversation

HID: apple: Delete an error message for a failed memory allocation in apple_probe()

PATCH New SF Markus Elfring 1 participant 1 message Feb 6, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: apple: Delete an error message for a failed memory allocation in apple_probe()

From: Markus Elfring <[email protected]>
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.

---
 drivers/hid/hid-apple.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/hid/hid-apple.c +1 -3
index 25b7bd56ae11..d739dd3aa622 100644
@@ -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;
 
Signature · 1 line
2.16.1