From patchwork Mon Sep 18 16:10:22 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: 9957065 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 83F13601E9 for ; Mon, 18 Sep 2017 16:11:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75A3128D5B for ; Mon, 18 Sep 2017 16:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A4FF28CDE; Mon, 18 Sep 2017 16:11:00 +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 216961FF2C for ; Mon, 18 Sep 2017 16:11:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754803AbdIRQKr (ORCPT ); Mon, 18 Sep 2017 12:10:47 -0400 Received: from mout.web.de ([217.72.192.78]:61715 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752555AbdIRQKp (ORCPT ); Mon, 18 Sep 2017 12:10:45 -0400 Received: from [192.168.1.2] ([78.48.130.71]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MOzsZ-1dnf6730g3-006MeQ; Mon, 18 Sep 2017 18:10:24 +0200 To: linux-media@vger.kernel.org, Bhumika Goyal , Hans Verkuil , Mauro Carvalho Chehab , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Subject: [PATCH] [media] gspca: Delete two error messages for a failed memory allocation in gspca_dev_probe2() Message-ID: <6bef0198-a455-6ede-c6da-58667771a45a@users.sourceforge.net> Date: Mon, 18 Sep 2017 18:10:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Language: en-GB X-Provags-ID: V03:K0:YeJQXnnjN60/qG7wtWIJ7c1iLpygBehmhiEPFZRki4sFFZOLEeD EPZTPX6fXm7Jl6QlW61v33kZQp4r9NgWxc1quADK1C0UTyIp3l+N9m6sf1pPOKArl5Bb1c/ E7KQbEZHX5EcCnz+i+RbwtXAY1P6qZW+pRtl0y+Vg2Die1Y/beIDpRWhGSgV/U8f7vcv5Fe qUyrJFr0kDkXlS6SybHgw== X-UI-Out-Filterresults: notjunk:1; V01:K0:wLc+gqlSb3M=:MW05egcSBBMC282YNdtaGr bfb9maXuz+/v4ZBJbJKKl3IN/shpcmxRYBrGY4On56TQlvtzNUBLd/ZRDDLSfjmxG+RKrBuq8 jV+jT7Kp/5iFVgjGIAAOg64ciPsfRZxjXMbhH3m3zyd9o7SSD1Giv9AdHF3SvB9ouzIYzreXA K/gnEgcifArC0DC4f2QFlEPG5Ew59FzGHafAEcBCm0CJXQok7lWI/zjk1AHNoF6DQEjz+pk9o LGbZ798NLsY8Pyw1t04NMlqOwo8fwr+RbKhp5CiDyu+0gTN7wchDsfC0I8XwZQSNgPkrTi0Bk eQCHYsK0I8eAMncbsvxhkFXHPu8gpbYxKW1t+q+MHq1wB2pghapz401j6/pwL+h47mxwAVIea Fxip0zS83QPwOGUYusrwVGaiIx3znq3Xw6B1az5ACNgOnZAHhZzdBosvQL5EwNO1EJY6u9bNy F4e61jibyQuH3vG9+rBMVw9z32gm3woPKnsFVCoRXS/HFvhfo6HVX3r8C0OMy8QHhkHnxPIMg xnTLWjkPktQCgWcJg1D/9po+48nDjsXC9AoLycwo4Ra7ruHR5zVNSosO5SLORhzqCx7C+Npr4 6Mqgiv1BaygFtJ/RT0PvrF3JA84Yw+M65pkFX3KKOwmalhAsSonMKoMwhkyQQ5CKDXqpUpbOu 7sCfFIIhvn0Osxwp/mviUgGkbDjp60FhqeoLfDe3tUEOxULyVhqVKxtglcJo/edQEMt7Od8F+ XDkY/Vze+ph3YHyvLjt7tf9Cs1tL7nzDf8CvR+l3ZrBzcXFubnHIsOxeONsMsjUkFwU98xgCJ MmbG8RxorAymncANpuRShnOJkt+xpha2VdSTsESUnRFUx307bk= 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 17:47:58 +0200 Omit extra messages 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/gspca.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index 0f141762abf1..8be1c81b7cab 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -2037,10 +2037,8 @@ int gspca_dev_probe2(struct usb_interface *intf, - if (!gspca_dev) { - pr_err("couldn't kzalloc gspca struct\n"); + if (!gspca_dev) return -ENOMEM; - } + gspca_dev->usb_buf = kmalloc(USB_BUF_SZ, GFP_KERNEL); if (!gspca_dev->usb_buf) { - pr_err("out of memory\n"); ret = -ENOMEM; goto out; }