* [PATCH] misc/phantom: Delete an error message for a failed memory allocation in phantom_probe()
@ 2018-01-09 16:40 SF Markus Elfring
0 siblings, 0 replies; only message in thread
From: SF Markus Elfring @ 2018-01-09 16:40 UTC (permalink / raw)
To: kernel-janitors, Arnd Bergmann, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
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@users.sourceforge.net>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-01-09 16:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09 16:40 [PATCH] misc/phantom: Delete an error message for a failed memory allocation in phantom_probe() SF Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®