[PATCH] misc/phantom: Delete an error message for a failed memory allocation in phantom_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 9 Jan 2018 17:25:59 +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@xxxxxxxxxxxxxxxxxxxxx>
---
 drivers/misc/phantom.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index 8fa68cf308e0..ab55d2114136 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -365,10 +365,8 @@ static int phantom_probe(struct pci_dev *pdev,
 
 	retval = -ENOMEM;
 	pht = kzalloc(sizeof(*pht), GFP_KERNEL);
-	if (pht == NULL) {
-		dev_err(&pdev->dev, "unable to allocate device\n");
+	if (!pht)
 		goto err_reg;
-	}
 
 	pht->caddr = pci_iomap(pdev, 0, 0);
 	if (pht->caddr == NULL) {
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux