From patchwork Tue Sep 19 18:45:40 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: 9959949 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 1DDB76038F for ; Tue, 19 Sep 2017 18:46:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FC7028AE6 for ; Tue, 19 Sep 2017 18:46:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 047B928BAF; Tue, 19 Sep 2017 18:46:20 +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 198FC28EC0 for ; Tue, 19 Sep 2017 18:46:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751671AbdISSqA (ORCPT ); Tue, 19 Sep 2017 14:46:00 -0400 Received: from mout.web.de ([212.227.17.11]:49616 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661AbdISSp7 (ORCPT ); Tue, 19 Sep 2017 14:45:59 -0400 Received: from [192.168.1.2] ([92.228.164.239]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Ljrq1-1dNFZE2rJh-00bs7C; Tue, 19 Sep 2017 20:45:41 +0200 Subject: [PATCH 1/3] [media] hdpvr: Delete three error messages for a failed memory allocation From: SF Markus Elfring To: linux-media@vger.kernel.org, Andrew Morton , Arvind Yadav , Hans Verkuil , Jonathan Sims , Laurent Pinchart , Masahiro Yamada , Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <82d14066-5816-111c-9d21-f6a439e559c1@users.sourceforge.net> Message-ID: <3dc5f6be-6002-5cbf-a820-d803f9afad69@users.sourceforge.net> Date: Tue, 19 Sep 2017 20:45:40 +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: <82d14066-5816-111c-9d21-f6a439e559c1@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:vWfqD5cPixDzOVS+kb83Z8uQnocBiPR/VDEL1t6HzW2T5B59DfZ KczC3KJbF7xeQCSgU2eKm4fVEy97foYagDd2Uo1UfbhdzfoFanZxu86TuFz+y9XmA17RQfX stxQYFQAB5nbOTEQVPuO4IZrdEKw/KPLudJjoActlzRr4ILWubWgTcx4LFBga9fyGsAAhuG FSmswdjUIYGZ4AevUOtvg== X-UI-Out-Filterresults: notjunk:1; V01:K0:6H888bY8DfM=:B0eevA57Iu5ZxoZNH4aTc/ fWIojk3vit9FnBmUmHKXRcidyFaJJtf5thv2eaUnGN2UJ7twuno1Op3ohDwC3U4eEEKF8tdYp NrxNJFTzt69xvLLi8o9wWgBQdbrbZoVzHlRiOAQCFE3Jv0iLfk+FyxJDd86cOIT8wO1WvMfAi CKQdrdMezOr32QO4dz61xQr6dTMH10PYi6XXgvZ5WVYkJDUdHb64jgtfQQpPFEi5P2g/L+BMw ZTjWv9Chvl632oqXaYZgBoKX8b9i82v3CM2F+WIa9jof95uiBkxSW7M3PuFbXcFdd7Rq1cIyR moJyvzFCrvBFXl4ejLP/vdKF9vBN+GlJJ6RH+TlyQb1cadOG0XyIuShf/j2Ca98OfBV2kozQM QYISR2L2kwHclKlBp+sV2ou4pupDCTB903JTwHE4grT2Lt3C3BTUhx1QuuvJK0Ab2fKLk/jpu yQ2uPo6Xr00DnQf9A+tH21pxa6jwknYMlSTwF8IY5JYaQHNJPUQmYvFE4TxAVHCBS6vZABWne 1hVCNXH4bTvQDPhmOLQbUIqmFAJA3ku3RSw+9SyWwnxxV6mSxi1rhXqhJwBCXRxHMWqBRoHAS 0jPLgl4sVF4DfeAqfEnjKcFiDlrI8WnsmylIe+fqMWD5Q0Wu/NX1ccDlCpQvYq1G9B680Ue5n QItzJ0mrpPKUqPDXmLUxDpz0CzI192NRwIhwFRyh4/A1kLHRKz/nqoRymoieEzxOwPnjrf6vz 5yllAbbaMouocSnh6uGZAtv0hww7ypZtXRt5QXZOv2V1j0pjWONzVQ6ELfndLGLJ55u/e5oZ1 oY98oaO65XLLVy6Iiw/3SigHRMJYkwD/D0tiBQ1GWA8EhR9y1M= 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: Tue, 19 Sep 2017 09:33:26 +0200 Omit extra messages 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/hdpvr/hdpvr-core.c | 8 ++------ drivers/media/usb/hdpvr/hdpvr-video.c | 5 ++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c index dbe29c6c4d8b..f1c156814e10 100644 --- a/drivers/media/usb/hdpvr/hdpvr-core.c +++ b/drivers/media/usb/hdpvr/hdpvr-core.c @@ -282,6 +282,4 @@ static int hdpvr_probe(struct usb_interface *interface, - if (!dev) { - dev_err(&interface->dev, "Out of memory\n"); + if (!dev) goto error; - } /* init video transfer queues first of all */ @@ -302,6 +300,4 @@ static int hdpvr_probe(struct usb_interface *interface, - if (!dev->usbc_buf) { - v4l2_err(&dev->v4l2_dev, "Out of memory\n"); + if (!dev->usbc_buf) goto error; - } init_waitqueue_head(&dev->wait_buffer); diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index 7fb036d6a86e..657d910dfa1d 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -150,7 +150,6 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count) - if (!buf) { - v4l2_err(&dev->v4l2_dev, "cannot allocate buffer\n"); + if (!buf) goto exit; - } + buf->dev = dev; urb = usb_alloc_urb(0, GFP_KERNEL);