From patchwork Mon Sep 18 20:11:30 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: 9957609 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 CB2AC60385 for ; Mon, 18 Sep 2017 20:11:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7C2F28414 for ; Mon, 18 Sep 2017 20:11:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AABDE28D94; Mon, 18 Sep 2017 20:11:55 +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 4BFC6289D8 for ; Mon, 18 Sep 2017 20:11:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751523AbdIRULl (ORCPT ); Mon, 18 Sep 2017 16:11:41 -0400 Received: from mout.web.de ([212.227.17.12]:55736 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750964AbdIRULk (ORCPT ); Mon, 18 Sep 2017 16:11:40 -0400 Received: from [192.168.1.2] ([78.48.130.71]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M89uv-1d88lG2b1F-00vf4v; Mon, 18 Sep 2017 22:11:31 +0200 Subject: [PATCH 1/2] [media] vicam: Delete an error message for a failed memory allocation in vicam_dostream() From: SF Markus Elfring To: linux-media@vger.kernel.org, Hans Verkuil , Mauro Carvalho Chehab , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: <78839a2c-2076-f480-79d3-e783d2f8c0bf@users.sourceforge.net> Message-ID: <51554497-b44a-d05d-d32b-02430ee96302@users.sourceforge.net> Date: Mon, 18 Sep 2017 22:11:30 +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: <78839a2c-2076-f480-79d3-e783d2f8c0bf@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:MS5lNuHrmxqpA/A4rKvRPk0fEy4VCBFu3bDzsUxEMcpXSmTxzuZ 6KDdt3gbLJAXD5fsxoC7k4Fn/UQk4A8B8AjHPwOBuHUiCVMbtPeVFr0pxchyInb/FlQY2RA Y3tONM+5VQhePsgfYvawuOZbf3h3kpDQ8JrAheF+1NlFS05MCq1RX9ji3DvQ8b6IPJMloZQ V7EN55gvuFC9Ckr8Jir7Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:2demJ+V2Lpk=:stToFHVfW45COUbSjDI4yw uLUsBa35fIC8lc69OuC9eoZ1iRpnBxZEgM+PIUUhAJX5TCBTbmQU9jG1rjfAs6B8TxbarRy7+ Z/2WkTAfsIVG9dOXEWjoDgaC8qTul2X6wFMnhSscsiP/w/y0kZ8g4SQbtC87RHLHkNmCB29FT MVhJqnzvQf58RsE0/spmX69hfrFAn2GSsaatr0qiUESlObZ4Ea4JeB2S1+bGYMw97fgxK+Mia 0lc54KoaFPFqckWj1AinK7C2th0WaA+bJSmfkFb3HA2rlinASOz4apSphaljovDgfFg9UwAPE Rgz5i4i/ELp/pKGRLyMP1CbHyclXsx5XBBx2LzMwlrxRMDKydrQD0ir6011dz0wCb7JQyHMNu VyZZ+VPoE50kO5zFeWVI+jrdOfysfcIfGxBcJ/Y8Qeu/lVXx2NGQqVBYFgjOrq7zQkQKFANet qKuXMICWgSpesBiCdiKtUgSEWZgQnnR4XQnvw8XYnSxVCQ6a/YoiM2mqhratGJngflGFry5Lj SPmIe7+0fZaxvvczChTpcMGAn89Apbqb3kBOQypvFSV0ho8HfRKW1iZiVcmlKO9VvGr13yPKa NXbtMvIEE9Dq+ixuxrl28G53Om9DWJrly9lLGCe78UNxdySXVV4njfXlCOw9o+gyHm/qpjvo1 iY0tIoT5EZ/NsSDdRUgJ4OI3i8HPgftJwEpth68fvXCP1iGpo4mqON031Z0FY1JNiFV6ro9lH CnD0J4/63zIPp9aaD0l2eCamijnzykyNJ+QT36AU/a4+CMGD2oPma2CSZxlcTgVnXn/7oXvs5 KbdxipjBYuEFIxJNugNIzg06neFoRZCXELPNuelenHwN90I18E= 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, 18 Sep 2017 21:48:55 +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/usb/gspca/vicam.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/usb/gspca/vicam.c b/drivers/media/usb/gspca/vicam.c index 554b90ef2200..15b6887a8e97 100644 --- a/drivers/media/usb/gspca/vicam.c +++ b/drivers/media/usb/gspca/vicam.c @@ -183,10 +183,8 @@ static void vicam_dostream(struct work_struct *work) frame_sz = gspca_dev->cam.cam_mode[gspca_dev->curr_mode].sizeimage + HEADER_SIZE; buffer = kmalloc(frame_sz, GFP_KERNEL | GFP_DMA); - if (!buffer) { - pr_err("Couldn't allocate USB buffer\n"); + if (!buffer) goto exit; - } while (gspca_dev->present && gspca_dev->streaming) { #ifdef CONFIG_PM