linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pci/setup-bus: Delete an error message for a failed memory allocation in add_to_list()
@ 2017-12-29 11:47 SF Markus Elfring
  2018-01-13  0:08 ` Bjorn Helgaas
  0 siblings, 1 reply; 6+ messages in thread
From: SF Markus Elfring @ 2017-12-29 11:47 UTC (permalink / raw)
  To: linux-pci, Bjorn Helgaas; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 29 Dec 2017 12:15:16 +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/pci/setup-bus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index b1ad466199ad..d131d29c4fdb 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -67,10 +67,8 @@ static int add_to_list(struct list_head *head,
 	struct pci_dev_resource *tmp;
 
 	tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
-	if (!tmp) {
-		pr_warn("add_to_list: kmalloc() failed!\n");
+	if (!tmp)
 		return -ENOMEM;
-	}
 
 	tmp->res = res;
 	tmp->dev = dev;
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-01-17 18:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-29 11:47 [PATCH] pci/setup-bus: Delete an error message for a failed memory allocation in add_to_list() SF Markus Elfring
2018-01-13  0:08 ` Bjorn Helgaas
2018-01-13  6:15   ` SF Markus Elfring
2018-01-13 20:17     ` Bjorn Helgaas
2018-01-13 21:08       ` SF Markus Elfring
2018-01-17 18:16         ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).