From patchwork Tue Aug 29 05:31:58 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: 9926751 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 65E2F60380 for ; Tue, 29 Aug 2017 05:32:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D2F028865 for ; Tue, 29 Aug 2017 05:32:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51E372886A; Tue, 29 Aug 2017 05:32:21 +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 1935C28865 for ; Tue, 29 Aug 2017 05:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751285AbdH2FcF (ORCPT ); Tue, 29 Aug 2017 01:32:05 -0400 Received: from mout.web.de ([212.227.15.3]:59311 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751191AbdH2FcE (ORCPT ); Tue, 29 Aug 2017 01:32:04 -0400 Received: from [192.168.1.2] ([77.181.80.150]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LrsGE-1dNZAH1PEk-013aCG; Tue, 29 Aug 2017 07:31:59 +0200 Subject: [PATCH 1/4] [media] zr364xx: Delete an error message for a failed memory allocation in two functions From: SF Markus Elfring To: linux-media@vger.kernel.org, linux-usb@vger.kernel.org, Antoine Jacquet , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: Date: Tue, 29 Aug 2017 07:31:58 +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: Content-Language: en-GB X-Provags-ID: V03:K0:VBVGwduWRBym9BCzeDST9OQeCA/AF2iZ0Y/kqTniPo3/ofaW0gS fkU7MIMHsheUO1A8bZ1DiO4DnDPoq8J4CCy7882HjmnGUiPf1mfOOmebNr7TYfremUS0L40 tmLDWL2jFD0OMmg/4iyOD5gwCwVGyhqupsl0Mm/o188RGLMGn3dfmuXhyiWPPkvE08Gcaev Jq3UbQEQBZVmDPo7LtKHw== X-UI-Out-Filterresults: notjunk:1; V01:K0:4Bfvs3j6/Rs=:TVqvQGFcHWnRbonQKneubD vLHFx5WsnMIR9CiIysvPgHUZA/l2c4oqSvADiMDVkYjxfvg1R82iBdQZrSY+G8paxEt7/bUNd j7vRLfJM4wjdWwLD6QSFaSaAM9SXqjs5YFNkw9MS9+sMdV/VfD5CWXh9+qxef/OzKANwpUU0v CVJjf2MJc7i23QUGghDEZw0QEPpGdA/OsG340PuK4yeHDZ1RE10wVrkGupD4bT4TNUdg9wu7Y BcFlgoCPNKFMylU+z/hPyvOd/luM0k3k7PEWrJT4HuXCVbgOSgH9OeDxVb6m0c0odVt7jRoyS d+1iAmCzngrDVnepdWPL+UKYgkDoKE7DcBj/uia9MVWIXtlFG86XUeE3Jbg6+kLCIMy+WGSeu 8ljfpoLwRNqJlP96wE8zmIR6rwIfsVLqJ0ktGQz2uBNPPRY5QQQsNcKWnqYvySGzTiWqC0fkb iX7jcaStTVPWz7kAGjVJKSGh52V7HxZKsTgaMFQxoY8z2Qk/uGl7d332kI0rZlrRsdGxkPTkm 2cAErQ/OiBa/G9nJwThsoRkVLFLQjtdDGz7P4jwDDYT1eHOiT/fzxiHZbr7mIKQq/s6N1Nz3X aSz0qi3zupwiWZnPCAUtyZNF+yDjC3TPFRWz1UvpsX9WSi85PUhmXK4IC2XzlTGwO+CS9DAw3 RC6UhWtn9234vNV0XJ/fq1UyfNKQ2C0gBRh4jbhu1uxD/qonREDuzTo3PZkEwKqcI8K7DoeDy k/yuHsyRGgVYjEv0zG7PGOl7Jss9XXDspzpzIQ4ZlD67qqDx8LWXJho4eomXuz7wtzrm3fKsm pE2gA3ywRyeqKnnQ45XeGsKB/KbgF9gnnClMULgrVxTp/V21Bs= 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: Mon, 28 Aug 2017 22:23:56 +0200 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/media/usb/zr364xx/zr364xx.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c index efdcd5bd6a4c..97af697dcc81 100644 --- a/drivers/media/usb/zr364xx/zr364xx.c +++ b/drivers/media/usb/zr364xx/zr364xx.c @@ -212,7 +212,5 @@ static int send_control_msg(struct usb_device *udev, u8 request, u16 value, - if (!transfer_buffer) { - dev_err(&udev->dev, "kmalloc(%d) failed\n", size); + if (!transfer_buffer) return -ENOMEM; - } memcpy(transfer_buffer, cp, size); @@ -1427,7 +1425,5 @@ static int zr364xx_probe(struct usb_interface *intf, - if (cam == NULL) { - dev_err(&udev->dev, "cam: out of memory !\n"); + if (!cam) return -ENOMEM; - } cam->v4l2_dev.release = zr364xx_release; err = v4l2_device_register(&intf->dev, &cam->v4l2_dev);