Skip to contentSkip to conversation

misc: mic: Replace kmalloc with kzalloc in the error message

PATCH In review Yi Wang 2 participants 2 messages May 29, 2020 Char and misc drivers

lore
Share & tools
lore

Yi Wang

author
#0 lore raw

PATCH 1/1 misc: mic: Replace kmalloc with kzalloc in the error message

From: Liao Pingfang <[email protected]>

Use kzalloc instead of kmalloc in the error message according to the previous kzalloc() call.

---
 drivers/misc/mic/host/mic_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mic/host/mic_main.c +1 -1
index be0784f..8296f31 100644
@@ -164,7 +164,7 @@ static int mic_probe(struct pci_dev *pdev,
 	mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
 	if (!mdev) {
 		rc = -ENOMEM;
-		dev_err(&pdev->dev, "mdev kmalloc failed rc %d\n", rc);
+		dev_err(&pdev->dev, "mdev kzalloc failed rc %d\n", rc);
 		goto mdev_alloc_fail;
 	}
 	mdev->id = ida_simple_get(&g_mic_ida, 0, MIC_MAX_NUM_DEVS, GFP_KERNEL);
Signature · 1 line
2.9.5
maintainer
#1 lore raw
Quoted 15 lines · Yi Wang

From: Liao Pingfang <[email protected]>

Use kzalloc instead of kmalloc in the error message according to the previous kzalloc() call.

---
 drivers/misc/mic/host/mic_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/mic/host/mic_main.c +0 -0
index be0784f..8296f31 100644

drivers/misc/mic/host/mic_main.c static int mic_probe(struct pci_dev *pdev, · line 167

Quoted 5 lines
drivers/misc/mic/host/mic_main.c +1 -1
@@ -164,7 +164,7 @@ static int mic_probe(struct pci_dev *pdev,
 	mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
 	if (!mdev) {
 		rc = -ENOMEM;
-		dev_err(&pdev->dev, "mdev kmalloc failed rc %d\n", rc);
+		dev_err(&pdev->dev, "mdev kzalloc failed rc %d\n", rc);

The message should just be dropped as the call will print the failure message anyway.

thanks,

greg k-h