Skip to contentSkip to conversation

hid-saitek: Delete an error message for a failed memory allocation in saitek_probe()

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

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

PATCH 1/1 hid-saitek: Delete an error message for a failed memory allocation in saitek_probe()

From: Markus Elfring <[email protected]>
Date: Sat, 3 Feb 2018 09:12:24 +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-saitek.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/hid/hid-saitek.c +1 -3
index 39e642686ff0..49355ceddd85 100644
@@ -45,10 +45,8 @@ static int saitek_probe(struct hid_device *hdev,
 	int ret;
 
 	ssc = devm_kzalloc(&hdev->dev, sizeof(*ssc), GFP_KERNEL);
-	if (ssc = NULL) {
-		hid_err(hdev, "can't alloc saitek descriptor\n");
+	if (!ssc)
 		return -ENOMEM;
-	}
 
 	ssc->quirks = quirks;
 	ssc->mode = -1;
Signature · 1 line
2.16.1