From patchwork Sat Sep 2 20:43:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9935817 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 E67FD603B5 for ; Sat, 2 Sep 2017 20:44:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA64C28628 for ; Sat, 2 Sep 2017 20:44:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF579285A7; Sat, 2 Sep 2017 20:44:22 +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 959B92855E for ; Sat, 2 Sep 2017 20:44:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752847AbdIBUnV (ORCPT ); Sat, 2 Sep 2017 16:43:21 -0400 Received: from mout.web.de ([212.227.17.12]:50843 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751192AbdIBUnU (ORCPT ); Sat, 2 Sep 2017 16:43:20 -0400 Received: from [192.168.1.2] ([78.48.84.48]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lrryk-1dMRGX3toE-013bCO; Sat, 02 Sep 2017 22:43:16 +0200 Subject: [PATCH 3/7] [media] Hopper: Adjust a null pointer check in two functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: <9ba22d42-0ec0-b865-dec5-4ce67ad443fb@users.sourceforge.net> Message-ID: <56d490a2-4159-204f-cd69-16fd9b268f29@users.sourceforge.net> Date: Sat, 2 Sep 2017 22:43:10 +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: <9ba22d42-0ec0-b865-dec5-4ce67ad443fb@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:i2oAMYk6wnZLgk4feW0ZnjG0sx/cmHv9BUcFAI66hL4bpfQLGdD 80V8PAhCPwVKuY1FpTyklbhWmv0PRcltRJtdi+/RfqrrM9VL+TAWz41uwYC1QDexdExtaXU H9viKd8i/qQUADd2sioKlVIY44hqcMIXeRlukuOquQN1KKxa7fNm6sTydkBBcr8p5dqjTn+ vMHNwrPfCEvXQzfLZbIlg== X-UI-Out-Filterresults: notjunk:1; V01:K0:oahOYOSMjRs=:KoI+EF6PvqWsnO4WjGjgo4 hWecf7Br42tAhgZk81E8LpGVjFs7KMpdng9Tqp4xWQRULX7so5oqBmlMux7W6YYYl/H6rx98s g++gBY5YNSCczcoHsCGcDtTfBxLFDcJotgvjLItFcF99dRxbJcPP85zZYd3FTZb7tSYxb+cYW szjtHMg83hKE7rCw+8dqcKxU5n1XCaqCYLjiZmT8qxTK8no7j+2rdDVrYXN8WpB70+lmy9W+c 3bywNC2fB8CUD0bi1ACQAOQYnJWPxRHA5SglFgNz6bb9EOGVCNvu1jEy09hyZsPtqwRdf0K+l lIj4YJpLhCGZTMEnB8t+HIZ3sil2g+MWZt85IXJQzw6gneoxT6n/KCGAgt3yawOr47xMbzwP3 CdAOKWfcTpxBaSLLaqpqf3EhDnLZlQrsHxY3SnaX8J099fdOT0abGyrE6wvIjzEWgDnJFi0vp plCppD1RCxNhdjKrbTdt3H+x8/0MvzsWVaFWmW8KyffoYpvuKH3FpJ7F6vU62soLhnpsC6oG+ +mN50fP0Zwk2IMVi7GZz91WfHE/yttp0vE9IYhLWUO9cRzX6xJWqMo9i5aUOResSMHdml6fcw CVQO+DjsA7B33XUkGPBFCRKKY3DZ9jS/c/YXOrTjZcBFmG4KmFO6ksNMUldepmjyxnzdlX393 o45bJLZFLxlK/xNjrch6rYA5Enym4QF+22ZiKnvtYRL2K4I9XYVE4AUskqou3XAnRQmIbGkeF zv5H/VYi+LWbQXm17p4IY0xZSjUD8sqLRdN4LAsG000Syt1GQigCCOZ131bnGkXnbJhghBlKN ivEEehfb8oU9NRzwfvOp4ZjAqLoRJQb82rt0QFua3Z05QtTc90= 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: Sat, 2 Sep 2017 21:25:50 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script “checkpatch.pl” pointed information out like the following. Comparison to NULL could be written !… Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/media/pci/mantis/hopper_cards.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/mantis/hopper_cards.c b/drivers/media/pci/mantis/hopper_cards.c index fe7b40c306f7..88e5b2a97005 100644 --- a/drivers/media/pci/mantis/hopper_cards.c +++ b/drivers/media/pci/mantis/hopper_cards.c @@ -72,7 +72,7 @@ static irqreturn_t hopper_irq_handler(int irq, void *dev_id) struct mantis_ca *ca; mantis = (struct mantis_pci *) dev_id; - if (unlikely(mantis == NULL)) { + if (unlikely(!mantis)) { dprintk(MANTIS_ERROR, 1, "Mantis == NULL"); return IRQ_NONE; } @@ -164,7 +164,7 @@ static int hopper_pci_probe(struct pci_dev *pdev, int err = 0; mantis = kzalloc(sizeof(*mantis), GFP_KERNEL); - if (mantis == NULL) { + if (!mantis) { err = -ENOMEM; goto fail0; }