From patchwork Tue May 9 07:29:04 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: 9717137 X-Patchwork-Delegate: kvalo@adurom.com 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 5142460365 for ; Tue, 9 May 2017 07:29:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44C4D23B24 for ; Tue, 9 May 2017 07:29:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3911726E78; Tue, 9 May 2017 07:29:31 +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 C373123B24 for ; Tue, 9 May 2017 07:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752926AbdEIH3R (ORCPT ); Tue, 9 May 2017 03:29:17 -0400 Received: from mout.web.de ([212.227.17.12]:58869 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752153AbdEIH3P (ORCPT ); Tue, 9 May 2017 03:29:15 -0400 Received: from [192.168.1.3] ([77.182.123.147]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M0ymZ-1e2Pp021aZ-00v3iB; Tue, 09 May 2017 09:29:05 +0200 Subject: [PATCH 3/3] ath9k: Adjust a null pointer check in three functions From: SF Markus Elfring To: ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Kalle Valo Cc: LKML , kernel-janitors@vger.kernel.org References: <03575993-754d-924c-9736-2a8d19e98fa5@users.sourceforge.net> Message-ID: <6c3d87e0-d758-6f9b-4b1f-156d890b788d@users.sourceforge.net> Date: Tue, 9 May 2017 09:29:04 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <03575993-754d-924c-9736-2a8d19e98fa5@users.sourceforge.net> Content-Language: en-US X-Provags-ID: V03:K0:o+CjdPD+arMMoVT9tFC61nE3RvteoHNgICFQF7rQzEtv0dG5qdj v3WzJVYxhUZJz/pdw+mnzoh0hZyMcfg11WPRsvsalJYk4kcgcOTrxchuJHKFj0uyHHfEWUB aJPS3wziWZM/g4Dp/wWaNHeXeVu+zjNbIPIz+2to+QdjBOFDTp/XJl6j24wH6T2vX5VH669 zr9uca91Doh2eREdPs8Tw== X-UI-Out-Filterresults: notjunk:1; V01:K0:S+zleFbyEvA=:Rjit08nFFI61ohjJxW3HCC Bp7eHoGn7os5TZsd7JsK+xHozym1nw6UFkgAaHKwSgPqMcVMFBkXTUwIgEvBvWfX1Z4dWd0XV Jx8z2GcB7jTFkZ9jZu+sLOjd99YmJI40ciaIYvk+qn2o+rXmpFuCRIs6xSxTac9S4dzHJM/Pm qh3M8LonTWqwRbSXHnvgei1fkJS4HwjnhmJgst1XQSlpM+SaoypjbyAKvZ/vH0fI6ciFbF18k 6svQC6ehXZTtfiWr8zqnrAnXHlTpIYI3Y4LZVo33KoE/nL9W4d3szNcwXYduHBfwtduGE6mkd y85vbunPIZGqUY/4Uv359/amMTHsLvDtXR/QBoRXMMsAYePWA1O8oK3dOvJMRJ0J3lq0yTLBf PEosMLoG1Gag/83p5P0IhQGFH5a/O2QD/6veofIi7U9sApVdlgchNjOCt5J00LSS4rSSFDtHn o18IHwZZfA7gsk1ohzR+K50rRphODncHXD57JDcYDoIwPiJ6Lu8ImA7Y9/sRMrjALaKhr40Dw X2TvM6TLtBdSehcgY1JRV5T1jZDbmUXTNitHlvgejLfnti87JdrZdfHA0TeEZh38GHIoHmWtK /YYUlCC3b7MnOm9/P0E6Xex8/IhYQsQeiUo7JenQi9XVA0J4+Lmx2wpw4qYUOYBTTsgb9uxLB ajz08rLxqWNC2kq2/OLozgDQPTtuYWTcHz8qNqcdeWiyYHuwJhYfgNDrJEdcTMMIxroeJ5M31 0tSG0n3gFaZ7aWEtqVgxw6dbFiDSGneJBQcym/t0GVZt/rBX2LO6/C8AHQhqIT+8NupGU27RU ciJb7xH Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Mon, 8 May 2017 22:17:13 +0200 The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written "!buf" Thus adjust this expression. Signed-off-by: Markus Elfring --- drivers/net/wireless/ath/ath9k/debug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 0d215598193c..5f2c1d8e8e70 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -161,7 +161,7 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf, }; buf = kzalloc(size, GFP_KERNEL); - if (buf == NULL) + if (!buf) return -ENOMEM; len += scnprintf(buf + len, size - len, "%15s: %s\n", "ANI", @@ -315,7 +315,7 @@ static ssize_t read_file_antenna_diversity(struct file *file, }; buf = kzalloc(size, GFP_KERNEL); - if (buf == NULL) + if (!buf) return -ENOMEM; if (!(pCap->hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)) { @@ -1008,7 +1008,7 @@ static ssize_t read_file_btcoex(struct file *file, char __user *user_buf, size_t retval; buf = kzalloc(size, GFP_KERNEL); - if (buf == NULL) + if (!buf) return -ENOMEM; if (!sc->sc_ah->common.btcoex_enabled) {