Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755068AbeAIQkK (ORCPT + 1 other); Tue, 9 Jan 2018 11:40:10 -0500 Received: from mout.web.de ([212.227.15.3]:63306 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754781AbeAIQkJ (ORCPT ); Tue, 9 Jan 2018 11:40:09 -0500 To: kernel-janitors@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , Jiri Slaby Cc: LKML From: SF Markus Elfring Subject: [PATCH] misc/phantom: Delete an error message for a failed memory allocation in phantom_probe() Message-ID: <73220c52-2399-12a5-276d-9145877a5bea@users.sourceforge.net> Date: Tue, 9 Jan 2018 17:40:05 +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:kNaKMyZ6xgam1OkwPb/fixDWf1a2InWiqvlhaUaRIOmPGpIzv+3 CpDWWaXsoi/ZfYFDH9CkPnjgunDv/6RTyCJS1kDtfs7vz9D4tG9mPTn/KvpJ1axFCPwezh7 dIAOTzp58ZRc0zRzsIP0zQGU42w+rMdUytx2a8thKviNVtZymwkp+9Tjha0C/opL8sZWyRh Sa5SUT+IMUZrTT6XoUNFA== X-UI-Out-Filterresults: notjunk:1;V01:K0:Z0pXKdP7pmA=:95rpl+9vDHUl6OO1lAcjdC COWtQvy52sFWMRVVZFeOdgBEn6D689p26tBzwJX3MSqdO1LNgrxQ8nQnkZVDxS4VDglncImki c3GIZ+dl6RMv2PZ0RJwmr+K7A9jQVGncdiKAKFzptRrC5fmMkubkHVdW1q0Iek+8ofTBktGc6 jUHyX23pfUQzM2uGbHAPJtYTfU0bi/k+xlfTOnC7/BEwHqHC5HPdOrc4M266IhTxVqi67vdMq xLE5XmKBLLk4N7eRoxzzh3TvOG0UhvfxB8hEe9+Ukm7NDc19uPG/e9adV+02ETd1CQc0SrXnn 1wmtVIxP9hESkguvP9yLMEKiHGpVYxXXFM4fj0y2OFGHOLAVUI7rAdaAMm8foOaZ/OBgBl3oS Tfu9V/P4ixYgW3WAenrU5ZmzIz2Oegx02/oV9zXvIe1iR8BgUhaWtBRIkAriq8zRPE9TsFCD6 NpVdnE4pft1ktkHxm3+I1ugTTOoeNE4El2ewnnHW7ljYniN8nvijuwcZEgh7+hfl8V1txp0u6 +6NTN+Ervh00gCyARMhKFzcfRHOxMc50k7viPtIbUw07rWfMwyixO9jC5dZcHRM7KkLPAP+C9 bpVljP8imBeEI+g2Tfbr8k6HdTi/vIhTeboY5V3VsG02y4DmF3G+EDGpbXqMFgQVjnFFN0GlA Dq3QaUN2uktmyZ6nhSpyukHF6PldvLVcJgxNCM29gZI9vMly7hsbzWDiquXy1R0BK9vUL3ZFZ zcPeJKN3cdsV4SFiG3BVOu3A5HY6NQHNRPXoM1gqrsSJBhMDjN9rOKct5x3B+hk7p2iF1QwPm PhQnGpD1c+EdEYGZfVq4/tdHFgbywYUGwbnXBDKYEPcckaXKGU= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring 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 --- 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