From patchwork Wed Aug 30 19:17:13 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: 9930683 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 9C2686032A for ; Wed, 30 Aug 2017 19:17:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CF4628765 for ; Wed, 30 Aug 2017 19:17:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8202A2877B; Wed, 30 Aug 2017 19:17:40 +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 3234028765 for ; Wed, 30 Aug 2017 19:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264AbdH3TRZ (ORCPT ); Wed, 30 Aug 2017 15:17:25 -0400 Received: from mout.web.de ([217.72.192.78]:62125 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbdH3TRY (ORCPT ); Wed, 30 Aug 2017 15:17:24 -0400 Received: from [192.168.1.2] ([77.182.113.36]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MBkPj-1dcREi24wR-00Akuc; Wed, 30 Aug 2017 21:17:15 +0200 Subject: [PATCH 2/2] [media] drxd: Adjust a null pointer check in three functions From: SF Markus Elfring To: linux-media@vger.kernel.org, Colin Ian King , Mauro Carvalho Chehab , Max Kellermann , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: <62e6221c-226c-3b25-08bb-4baff9b23cbb@users.sourceforge.net> Message-ID: <7c1d8396-bd00-8656-c105-596bb47405ab@users.sourceforge.net> Date: Wed, 30 Aug 2017 21:17:13 +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: <62e6221c-226c-3b25-08bb-4baff9b23cbb@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:W5iLCYqsE2YNhz89he3w71iS2agbqyizK2jF9YU7Jjvpz5eJGCm jHOvXx5WiW83SN45piS0A7NXKMZOExaB8eYDvJsh0fyycEbLyt7mzoISUBpsvsh/6SEbrxn aGVWGQ7pbhAHz0mzvVnHnCjdhP/v16jrBSfm6rF2CoEyY+GcEroaMVkN7Y+kPDeTtYu0I5D YoASEyp7STCub/b4wrUrQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:zy5mc9adprI=:nP0HZsca3eO+lOs2DYExYp b/Ot4Mhdti0Fs630DtdikIsreRWLh9MTMeV7BukAFHXCf5AwFW6fvR+67slAZAPbmHacRlzjl a2yXDiXuz1TUTQoM4pEdY5nTyzYS+qEAsBJOeYf+2ImlYXens0kYxZtsbOjQYX/VUkZBatXn/ YFricIz8B2eijR99Z16fAEKupnXYpvUTk0U6d8GVfEszM8HUpbM4MuayQvSyU8i1FF2R+L2qU unAvLlz3xFHFsFu2EIpfJYWWfXQU2v1GDUFwaAB4yXOz1ccuq1txdGNomoSrpafdo2eVQk/lM f666ILDKiSIMnXi5/L5r01Ib2Lst0CZfETKjZm8R9DJlVeUkOVWlPlreW3qCY12oO6WdYada8 K9/KbPuYsZSzaF6Ygys9yfaIyC2vB/Q8k9cBPpC8pGzUax5jTfDgjDDoWJ7NlNcFv1FDF0nAh mQpWARBprg9FpMhTLrjZC4Q66zLBPLxJLHBOnsQBuc+MAHWNO6mX7VCLcGYAJrmTOVgle7suJ 3kZDx99W/gIEIxVFyki45cL8hqaDq/8Y40IPYvohIqyJgHxQG9oOTtAj72Z24yT/zSaVBaYsW QWhSZohUDSaacRTU9C38xrszCyExqOxeXUTlzgl4MK6Z8+PFJtWoShFmZT3BQ9Y9tYwCmKhAx LU4ymINIbROfiNRAnJY060k+mg1ROJEFjNrqFa6UUC+lwnc3hhujqICJXZGIjGBzYbuuP9cYe Plty7HDWNBxLNwW2BuuSfX/2LiFPh6cYNS6sN3XdVmMqkE4z3u6h3XDK6WqACPEAHvgpNbJ7u SBxiu86qIYgMgQ+6AYKF09MFSNIkBn3C/Z6z7s5NTBTqQjTk48= 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: Wed, 30 Aug 2017 20:55:17 +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/dvb-frontends/drxd_hard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c index 47b0d37e70ba..3bdf9b1f4e7c 100644 --- a/drivers/media/dvb-frontends/drxd_hard.c +++ b/drivers/media/dvb-frontends/drxd_hard.c @@ -328,7 +328,7 @@ static int WriteTable(struct drxd_state *state, u8 * pTable) { int status = 0; - if (pTable == NULL) + if (!pTable) return 0; while (!status) { @@ -909,7 +909,7 @@ static int load_firmware(struct drxd_state *state, const char *fw_name) } state->microcode = kmemdup(fw->data, fw->size, GFP_KERNEL); - if (state->microcode == NULL) { + if (!state->microcode) { release_firmware(fw); return -ENOMEM; } @@ -2629,7 +2629,7 @@ static int DRXD_init(struct drxd_state *state, const u8 *fw, u32 fw_size) break; /* Apply I2c address patch to B1 */ - if (!state->type_A && state->m_HiI2cPatch != NULL) { + if (!state->type_A && state->m_HiI2cPatch) { status = WriteTable(state, state->m_HiI2cPatch); if (status < 0) break;