Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755706AbdL2LrS (ORCPT ); Fri, 29 Dec 2017 06:47:18 -0500 Received: from mout.web.de ([212.227.15.4]:51119 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754860AbdL2LrQ (ORCPT ); Fri, 29 Dec 2017 06:47:16 -0500 To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] pci/setup-bus: Delete an error message for a failed memory allocation in add_to_list() Message-ID: Date: Fri, 29 Dec 2017 12:47:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:cT9efxao5bXyauu9RvyTOLTWsLnA9HGH272aRN7uHYN0a/zAM7W sdWD9GOsNfUeRX4HfSm806jDW3IyIEolAZRHCSup+62yDyg5WVdabiYP20SGVUldzlH/6ny eyZ84qehexkt3xAOko/7w465tEP7TmaUenL6nXVu5Y2tP770ZOeKLryuEhBSFlrdd4Q3IHg MoRUW3UdU/UzSMj+yEtVA== X-UI-Out-Filterresults: notjunk:1;V01:K0:JuEj7TpuYzE=:AW/Mn06BF2JsJQy28jWv/E VTQuaReGYV9yjDCG6Up1wRERm6kroL5Y6x9xkPQi6h7EUgNDdC4ZZVcYTq5gThGQm+z8XgamM 1nxv1hNWDLHzFZv/87jnpc1C6b5rcSvxvs+psYsC44XmuKDsaXNj6dQ/icaZ0nG6u15g51v0E tdkdfqQ5Xz44taM2RGz6dHaV4UVMoIyZRcP2hnrbyTFKgqbe3vbQXNUA75DGaBcf1C321yjXc TRcN0NaIJWy1l3A2e2HxZU6TwsmSFwz9135zXgYCGLwc2nblvLqTKsS8m/KMchwNknPlVYgJn ggkeE9kGg7RhBIZkSkh0ztzegio07S9KkLlRTeJIBSv6tEk3n2yPHapprbchOOazo9ifTkQrK rp9bv/rYIN9gMBQ+n7gZ0kwR2p7gu8Nb60pDzahDZYBWAf0r70TWmol39C/F/eC/mh5gMk006 zJZBPRPBW2mQASXtl1osE95oGY9fWucGPRMT6gTlSVPEWp97HNVb+sWYBrsx/Cmrl2c7yCDBx jqMcUsUd2PU2aSxyP8jSSFDXMvNN55V3bdtzAEbJ7tDDIF3lKLSKyNrKEC86VdvxUcEN0bkbN XDAze1oqJ77MJr+RJ60q72K42moFeBL7PuL8QsgJ4VZXi5VhJ7eag5jn4RiAMq88Ne99PZw57 8dlKfyr+Z52GwHp6Mqqi/NSoyHyz1HKopAjJj1KgRNpJ/XPWydOLRWnsFG66rt5FfSfx3Yt8H YRVPHHGrD/1obQOROqA1Hyl2Wl0dpQ7eXQALfEk3Tmmlf2B4DLpYt2kGWed0v/iWiFYnjSoB6 fPF5Y9Al9o/m/L1zZAJy+DP4dIoAE6KzGLKYJj4w3QRPKfu7mU= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 825 Lines: 30 From: Markus Elfring 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 --- 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