From patchwork Sat Sep 2 18:41:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9935683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D51E8603B5 for ; Sat, 2 Sep 2017 18:41:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAA19285EF for ; Sat, 2 Sep 2017 18:41:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0D4028681; Sat, 2 Sep 2017 18:41:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71AA028680 for ; Sat, 2 Sep 2017 18:41:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752780AbdIBSlS (ORCPT ); Sat, 2 Sep 2017 14:41:18 -0400 Received: from mout.web.de ([217.72.192.78]:65237 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751596AbdIBSlR (ORCPT ); Sat, 2 Sep 2017 14:41:17 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LuuFh-1dNqkL1pXV-0106Ho; Sat, 02 Sep 2017 20:41:04 +0200 Subject: [PATCH 1/3] [media] cx18: Delete an error message for a failed memory allocation in cx18_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Andy Walls , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <016d4c9c-1d8e-e277-5d7c-f433553cf0fa@users.sourceforge.net> Message-ID: Date: Sat, 2 Sep 2017 20:41:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <016d4c9c-1d8e-e277-5d7c-f433553cf0fa@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:Mo6V/eim5pa6WRyaP+CIDny7pEQa7Knsq3BYifcKH87zU9h4aqi IgLOMJQjXIUxau5v2JFquX1ZrGE5gov4M3GQRJn4tsTPKvn/vedf/UWdY9F2MMUhos+/fkB YlNGlLtkuj9uZ1tQo0QtuFj4SnXICQlhvy5dlx5mLIlG1thMo/WoDZ9tyo03JSMIxPA+X7x NKZ9/kHBwktBVLIhn8NMQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:u0EqLOy+C6U=:l0q+5k6QuzlDQ1v3W1CV2d roE/AX8vl36eGaCX30bF4x3Tfh24nhWhlTbXSEf8y5Bvr4/waQK69u9Z5arqTcqFvk5MNDAnL M5lrNJrrDDE15/lGO4WEJU6WumstHjInrui04THEDnGJ7FYEH9zZKini/GFPJf9TtDXjCuTBV XXUxv4WJwbqsP1/8ePJanooQ+/gO6yIRR7LEZ1WnsZvhSslyruQEPDyHZWP541xlWjTKsaPND 7saC+GAp7IGDaG2rNChq0pNI9XY5MUR4AiK1iPYhCIU0gJuEEDwMgFsr165ArIgykL+1wsSXt HXBoifKopLVP6Z2DauLH8Y39b/XcoauwicLHjCpKyczNnr9j9IiBAnoXgl/PzRDTYgg6f3luZ a/Uw5tPrSUroGIYKfYsy3PEhijgfKOpeikNFFuL+KJK+wzHzQR1Bb19UGr4l5fp5c/E1IEFT7 pAMem+Uvr3cGMuOHxtzPetvuURbagOWuwAHxAMjVG/smR4g2uRD9APagH3vVYaNMM7LBqN633 4/sJmTJOMwUnwnBvY1+7W8CxtqqzW3RkMHd8mRkYAnz7ZM6fCBe1eyaGwetSDsBCPBKvyoeMw +5xLavlg0nVv33ZqBXCZspog4F0x33U3AZr+J2lkveXRYiDlGj4DlHsd0lP8In+L0m5ALanLG 9vXZw8eMQEMphD9roGBB/XtvvP9ItOkzpwSEnO69+1vqMaBmRfbTyU7n/AMfwR272wwMSgABz 34Cc91dsRxuXUsSUWfiwWw5njEoG3+0exCgFK5ypT9WG0zvUo21mhiRII8NxqPBB24mIt40Zz e4EwC3CC4RW+8YnQ5UxVkLWa/y+12IS1hTimg+Zs3IxH9mJW4M= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 2 Sep 2017 19:39:56 +0200 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/media/pci/cx18/cx18-driver.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/pci/cx18/cx18-driver.c b/drivers/media/pci/cx18/cx18-driver.c index 8bce49cdad46..b267590e0877 100644 --- a/drivers/media/pci/cx18/cx18-driver.c +++ b/drivers/media/pci/cx18/cx18-driver.c @@ -913,8 +913,6 @@ static int cx18_probe(struct pci_dev *pci_dev, - if (cx == NULL) { - printk(KERN_ERR "cx18: cannot manage card %d, out of memory\n", - i); + if (!cx) return -ENOMEM; - } + cx->pci_dev = pci_dev; cx->instance = i;