From patchwork Sat Sep 9 20:32:11 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: 9945443 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 BDCD3602C9 for ; Sat, 9 Sep 2017 20:33:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B32BD28A26 for ; Sat, 9 Sep 2017 20:33:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A82C428A3C; Sat, 9 Sep 2017 20:33:33 +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 6179C28A26 for ; Sat, 9 Sep 2017 20:33:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751099AbdIIUcT (ORCPT ); Sat, 9 Sep 2017 16:32:19 -0400 Received: from mout.web.de ([212.227.17.12]:59253 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751012AbdIIUcS (ORCPT ); Sat, 9 Sep 2017 16:32:18 -0400 Received: from [192.168.1.2] ([78.49.13.42]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MSJC3-1e2YeU0rZT-00TQnE; Sat, 09 Sep 2017 22:32:13 +0200 Subject: [PATCH 2/3] [media] xc2028: Adjust two null pointer checks in load_all_firmwares() From: SF Markus Elfring To: linux-media@vger.kernel.org, Mauro Carvalho Chehab Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <10e92128-444a-bec3-e021-61379c21bf4d@users.sourceforge.net> Date: Sat, 9 Sep 2017 22:32:11 +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: Content-Language: en-GB X-Provags-ID: V03:K0:fDyjBYUQG+u9ktN7CmjmrJDtzfMTKrP7/LsuLc4+LTvThYL8X5a DKhxD3H2IDB5dUxvJIm2fdt5/RSmp8fEBcrVzrcOolA5//L2lp3efNT7Ys1AK820vR+4SW+ /h/U+EvU8uVdoeCPAF3gyvbRnOQBtZHOPdXFZp8niGZ01Q12j59vaJeaG998xqlAWA5HR/z MkbPRGz8SORG/22z8MqTQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:UE9JiyPmiiE=:MwiET5Wd+WXVdTE6oxTI0u SDPm82zvBVkA4NhPYv4fc3J60g1/vRT82qE435uXRsqUAE7lDRvcLFXiPu78lPEBdtPyZOYGs 5NN7vwksiIM5Y+2zhGaAM+oV9ajM3GHzk5YgjqOZ3/6F34WCYdfM9VKeql5UMXEhxryYdJOZh 4c1VQiwMX5thRcQsY7ymSCYaXeLTfeQBvY+k3zuTO5wc+9LBxaiS+28ZQLlR53XE6hOnnVE+n 5dlJD2IrmwxDT2epf2N39Qfayiq1QPxOJC345pWe5MOdTXhmjS+Ur+OU/Quqp1YK8hDIybnAJ XlfE2uZvRI3EDCbbR/lK/ZPwg8gqffnwF9GsNbpvGYjupq4+7NarvyiWSAH9J5tuTKtDqbd8B 2EJQuuoS6coW/TrAJ9aKMdND7QykiDksEgDu4Q+7hHA0FM/fZtGA4q82Im+Nn/F2hP5JSTOh+ NVIKwdb2qSXgbMwZWzfaE31R9u0rbsBOSVyzoMy5gDD/hHlA1TbZvLDRphloaljn0ZOBtD/9l F1fJabNOXTJFJlIxmA66GNble6X4wQPhIjAlMC93moasM95rfhTxW6xZ9Y0pV17fnqJ81K5N4 ZGW4hh5C1X/TCvPvQt1YEYQSakHkv0BaQbVfC/V/ps6rkI5FbsJWcvQEEiQPXkMoCVTnCQjAG j22Oux0QBN5QSEGtvadW2dFb98OTdfB7tSTK9I6BlD6H8S5SBrn2LIEzVc597vZaabzueTcBo g7SgrUOmb8ANaOU2SYZ8R6UsqmqcfOc+nzTble9S2re8oBOhU/Z3K0ZcQKKMqM5BcAfZan1KP dW+4aoJwLXA2yhDK2giEDLmoGesGq9ytcZqE1Vhv7sFbBCkXJc= 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 21:48:58 +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/tuner-xc2028.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c index 7353f25f9e7d..90efe11aa0a8 100644 --- a/drivers/media/tuners/tuner-xc2028.c +++ b/drivers/media/tuners/tuner-xc2028.c @@ -335,5 +335,5 @@ static int load_all_firmwares(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; @@ -384,5 +384,5 @@ static int load_all_firmwares(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;