From patchwork Sun Sep 3 14:02:17 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: 9936367 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 105C16038C for ; Sun, 3 Sep 2017 14:02:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 037F128666 for ; Sun, 3 Sep 2017 14:02:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC7612866E; Sun, 3 Sep 2017 14:02:56 +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 9BA6F28684 for ; Sun, 3 Sep 2017 14:02:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752984AbdICOCg (ORCPT ); Sun, 3 Sep 2017 10:02:36 -0400 Received: from mout.web.de ([212.227.15.14]:56697 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752828AbdICOCf (ORCPT ); Sun, 3 Sep 2017 10:02:35 -0400 Received: from [192.168.1.2] ([78.48.243.242]) by smtp.web.de (mrweb002 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LwZ5z-1dQHeV0jHj-018H4v; Sun, 03 Sep 2017 16:02:20 +0200 Subject: [PATCH 1/2] [media] meye: Delete three error messages for a failed memory allocation in meye_probe() From: SF Markus Elfring To: linux-media@vger.kernel.org, Hans Verkuil , Masahiro Yamada , Mauro Carvalho Chehab , Pan Bian , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: <4370c644-e440-1268-089b-8a8686bbcd5c@users.sourceforge.net> Message-ID: Date: Sun, 3 Sep 2017 16:02:17 +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: <4370c644-e440-1268-089b-8a8686bbcd5c@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:SYAuaMYO90e01yGmQrm/kniAQL4YTuzqEINiR887bdSh7ZgsJFW C99cL8g8VN36lbl21Lw2T1VyMOEe4loko6KMvv+vi12xD8KiR66iGUCiHF7mCXHamkBPJ9H DlV176hWBrFp3D1CiuWQmictFuf1p6ByYoe9skvSKqZkxYYCCViIc4gpxgexZy+f88MLgFW 1+aS4I6hfxK34JI9JSPmQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:aIb5zPiIFGk=:DjXPz2LJtEEvGZ6QKBBX88 eLi8GVclanmjTcmVEmutTDAcG4WGFgmvVlqb0hV/NRoNyIio6a0YYRhxrj8NEzRK2qtvaqSMq sgGoLeTGAcD3FgBd431sJCJ58OyFVo4HHtgWrxt6EkvvZ5xkT89IDenqkmf0G2nJHldGD59CK DIgNiywFwn0h9na1RFd08bX0ue6nR1Wd/mh1eLopQN2sT15CtgiDtf0F2rIZ4xMmhfVVNXtHb S8eLUjYVZnvhPJ75ze0dW7Nt3pTcCs/OwBD3oktcqQYBUTQdRRPxf0pHqoydvFZINjFhA3hFG I79jFEcWTgBeaGWE+PieqS0vC15cdm/IHLOOkBvvCX6MPtxjwHA1MT/dL2ti0Yxk7PAxjG1y5 FDk1Npi5MdXS6jg/GWgBt4cU+29KNRvX4Fsl2QTxjMe8vHCBXytlb1MyeYEJAHzwv9TM5OWUU C59dlBWYHeS+HUD/IUSPuv9iSjbRN0d0lNMxsSl+07hN+uZ9HbnSHB0EoWN5x8ATYD8IhwLix 4bDIfslg2EVrDcZntM9+np307sjcWNmJEHGgJv5JDIE7kjCVNpmdEU+Rb+8tqBZUmG5VbGldg XmxSuI8S/DKbQ3oNOiOLF8F9nyEr70HVJb8oThKTiO3lEPKziZk52o/syjxLJJERwqfIRNhuh pJRaZxk8ryTXePD3wMqQ1bfW2XRhtlhp89TfIsC2IvgGF54E+Ei/wwSidK20hnqSwUE75QuD6 cN5F7YgnOKLTUnEenha9QU/nmJRrspg4czAmCV222Mqr9ys6I/C4I/IAmH+YlPWBrpxVEfCkm Fz3CZH81PXrrEvWu+mBqMuH5kGGUi8gmnmOm0gvEFOH+QVsync= 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: Sun, 3 Sep 2017 15:30:04 +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/pci/meye/meye.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c index 9c4a024745de..db36040770a6 100644 --- a/drivers/media/pci/meye/meye.c +++ b/drivers/media/pci/meye/meye.c @@ -1626,23 +1626,18 @@ static int meye_probe(struct pci_dev *pcidev, const struct pci_device_id *ent) meye.mchip_dev = pcidev; meye.grab_temp = vmalloc(MCHIP_NB_PAGES_MJPEG * PAGE_SIZE); - if (!meye.grab_temp) { - v4l2_err(v4l2_dev, "grab buffer allocation failed\n"); + if (!meye.grab_temp) goto outvmalloc; - } spin_lock_init(&meye.grabq_lock); if (kfifo_alloc(&meye.grabq, sizeof(int) * MEYE_MAX_BUFNBRS, - GFP_KERNEL)) { - v4l2_err(v4l2_dev, "fifo allocation failed\n"); + GFP_KERNEL)) goto outkfifoalloc1; - } + spin_lock_init(&meye.doneq_lock); if (kfifo_alloc(&meye.doneq, sizeof(int) * MEYE_MAX_BUFNBRS, - GFP_KERNEL)) { - v4l2_err(v4l2_dev, "fifo allocation failed\n"); + GFP_KERNEL)) goto outkfifoalloc2; - } meye.vdev = meye_template; meye.vdev.v4l2_dev = &meye.v4l2_dev;