From patchwork Sat Sep 9 19:14:47 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: 9945413 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 1D3A9602C9 for ; Sat, 9 Sep 2017 19:15:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D8BB28A4A for ; Sat, 9 Sep 2017 19:15:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0259E28A51; Sat, 9 Sep 2017 19:15:29 +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 D8B8A28A4A for ; Sat, 9 Sep 2017 19:15:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750869AbdIITO5 (ORCPT ); Sat, 9 Sep 2017 15:14:57 -0400 Received: from mout.web.de ([217.72.192.78]:61922 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbdIITO4 (ORCPT ); Sat, 9 Sep 2017 15:14:56 -0400 Received: from [192.168.1.2] ([78.49.13.42]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MEmoQ-1dgFko2q1y-00Fxhe; Sat, 09 Sep 2017 21:14:48 +0200 Subject: [PATCH 2/2] [media] xc4000: Adjust two null pointer checks in xc4000_fwupload() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab , Max Kellermann , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: <61016489-eb01-2977-b094-343aa70686b0@users.sourceforge.net> Message-ID: <68444473-5d87-3213-4640-6069c88db1a9@users.sourceforge.net> Date: Sat, 9 Sep 2017 21:14:47 +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: <61016489-eb01-2977-b094-343aa70686b0@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:5Be+mdmVz2pnNQ6abh1s9yyf5+rBtWaEKcQt2HUkeS4rc6Z0yka CcgUWjxRCRP776IuCpW0rzJE8tJmk8ndZwgsc5DLdT60Buz5f4uSb9hOlfV61oHAKwRQAn1 I9zqjuu4PIcKpQIL2TX0G7qtGIgb6DIvE+N7+uShWQJKNWGQjO+eJKhq5bSoWHZyNvzK14t i+glllWot25+TDxeMgs8Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:XsEoXS56SJY=:kIN/yQOjxQN1oIpqqhp9Nb tA1CqVWKHCgyyO9weQMFdcaZJld1TV5Oi6odmbojA2WU8L6uYGdsZcoty9HpCf/2DwIodB+DR jUzHR81EtXqo+EQMS3hRX3gty7DqbxtkXnn4+qo1FSFI/UiHhucDfXC2S7GPN5UtXY/3BmGut KNQDHGz4PDmfogNiPsn0rttNq/P98JUh00tluNskCF0zhmtFtGbOhZCYL1tZK9TlL7aMTJnBL 2ki+f7dyVQVecvYAwbw22osVTnM6Uph3j+otPQdCdMQ+wUXjgjpLv+cbrKZLAAVitQzWQsnld crfbaBhRYvZcaMjoQtIf/z6zUQuV4WY78pG0BikrwuWgpwjc20NRSOXhC1VBtU5RKT+DvEQtA l7fl56a+585GeYgMfj77kkp29TQSS1J04OBNTXOynMZAlPUkTo9q00gI9c15F1lQShJHfS9gl 4IWIvVywPykIPQOP++rTxLlpiTc/H86smJXz0w8f0dGHKj+HutDyPbRfUmCXEkqaIe1QMYVsW T9+koTwz983PmKMf166sbFnNa5GUDoEbfBwWJZeUzrNn//j3RVAoC8c7Nss3z9HHOKlzcODRQ wnGY7OhVEZMHB7lpMbNEU541ita5pEFS3QD63eNS/pWtFwFlLbUJyH+LNFnxDGBA0IjICWu/o ZSpnVV1bxHcJCuOP8R/zqLzBYv6/+HjwuEQL7ws8ugJC/Stsvy9DJ8JeRPpxN4DUGCdM45YmE Z5j2QuCN2pD8qu1k5MHEIfj6aDp/gvK4V1X/hhRHU8mIxDI/AMeec2iKETgov6kAv6vmWalED 5aJaah2mIjAfVjXhgCaZDu+a8U4sn/VZYFdu9So2aTOUQx6mPk= 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, 9 Sep 2017 20:55:14 +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/tuners/xc4000.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/tuners/xc4000.c b/drivers/media/tuners/xc4000.c index bbf386127fc4..bd53e44b3cc8 100644 --- a/drivers/media/tuners/xc4000.c +++ b/drivers/media/tuners/xc4000.c @@ -775,5 +775,5 @@ static int xc4000_fwupload(struct dvb_frontend *fe) priv->firm_version >> 8, priv->firm_version & 0xff); priv->firm = kcalloc(n_array, sizeof(*priv->firm), GFP_KERNEL); - if (priv->firm == NULL) { + if (!priv->firm) { rc = -ENOMEM; @@ -821,5 +821,5 @@ static int xc4000_fwupload(struct dvb_frontend *fe) } priv->firm[n].ptr = kzalloc(size, GFP_KERNEL); - if (priv->firm[n].ptr == NULL) { + if (!priv->firm[n].ptr) { rc = -ENOMEM;