From patchwork Wed Mar 8 13:15:34 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: 9611447 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 AB3B9602B4 for ; Wed, 8 Mar 2017 15:35:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E78F285ED for ; Wed, 8 Mar 2017 15:35:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62BD3285F1; Wed, 8 Mar 2017 15:35:28 +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=ham 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 E5BA3285ED for ; Wed, 8 Mar 2017 15:35:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753254AbdCHPfJ (ORCPT ); Wed, 8 Mar 2017 10:35:09 -0500 Received: from mout.web.de ([212.227.15.3]:60857 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753191AbdCHPfH (ORCPT ); Wed, 8 Mar 2017 10:35:07 -0500 Received: from [192.168.1.2] ([92.228.144.238]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MJIMc-1coMKN0rc2-002kVH; Wed, 08 Mar 2017 14:15:41 +0100 Subject: [PATCH 16/26] IB/ocrdma: Adjust a null pointer check in ocrdma_alloc_resources() To: linux-rdma@vger.kernel.org, Devesh Sharma , Doug Ledford , Hal Rosenstock , Sean Hefty , Selvin Xavier References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: <54750756-91cd-b508-109a-83b7b2375193@users.sourceforge.net> Date: Wed, 8 Mar 2017 14:15:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:xczDVwi9hiom9kngj/FuPifCLrgNY885m4Jt1cqDazciM962yG+ 79IH5Qf7xLn5+cmtA3R0V40gRB/FkAb2fICF1mcZwKuL4JjajjsSdbnBVZFllN+w3rSiDiV B0PEpbj9OX7SpS/zgrNrHooYrprlpFGgbmco8mxqCBv7K4PBy8ZQNhYQ45JT1h6ZK/Jq15I SVi7Z1iKuu8ww0YTISy6A== X-UI-Out-Filterresults: notjunk:1; V01:K0:bycoxW3JWIg=:LP9y+YvoNfWZhLXLfeEiCo yQDucVFpR+HjLI2sqIEfKLdS0xvlriQcmAw6qpxYioJ4b83/ckLZJcNRjI7YJrEHSRwnjU6xU paTRgj+ynPska34m+HWB3B8WZZ5taW1keyzMlx14OcLJvx5EWyZxsuCG6MyoKE5t+STfIgr0p k5U3TCeyOFhrkvEQE7kW4Bi6HqU6bOpd4KYQw+eGFNY1UaKcKFwSqKCzEeHz0qUIgY+yGFTVN 2f8m+dgzzpeFbpF1rb7V/9fRo4cCk+ftVXUDy/dlFwzQ63VFh57MujC52BC/mhlpqUjnpOvSN Bro9IHuxpwUAmhqBj43WLZ1MUpGsBR+olu7fP49U3gGA2RAQnFvtxrZb9BTBu+QPcpXCr43G4 7QOSCKN2oJKRRYfOIRbCTPq9UnTVB4ByQfeLLtlP+HLJSq8hOgbm5HlRzFNxg2AhYgcOqVr4M KZCqK4Qez/hZrVyqsXSrBsI1kgDH/IdgocIaEcs4NTUitkvZ6p9bV+jSjUs3OqHEbXN7bfmjw J/Bh5KlqQkYJWRnIg5ZtbkSG1z1d6KZuaN9apQYPj4gniPUN3tKHJizEjBIv8uj9FX8xLjY3K wheA1CGCyj0MLN6cLpF1IZvjpZMgNxO5oRI3IERPxjcZTK1clIk7gVz1dr7QYn2K2z8/fhana V7p8Bi/GQonNT7G4Zg5vB4ZaXKgdvPRyFxSmPFZUkN4qQBa96CGyZM5VtiqE6funkuq1wj/By hGHk4p2Fu88Oq2nHjeyg8kZ9YcHiYOqiolR7yBl1gDllSo7Rsn5EPQoYl8h7Oa5/+5mxCjdF7 cZZ3/8v Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Tue, 7 Mar 2017 22:34:33 +0100 The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written "!dev->stag_arr". Thus fix the affected source code place. Signed-off-by: Markus Elfring Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/ocrdma/ocrdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_main.c b/drivers/infiniband/hw/ocrdma/ocrdma_main.c index 93113feeb2d5..fbf672c79d5f 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_main.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_main.c @@ -238,7 +238,7 @@ static int ocrdma_alloc_resources(struct ocrdma_dev *dev) dev->stag_arr = kcalloc(OCRDMA_MAX_STAG, sizeof(*dev->stag_arr), GFP_KERNEL); - if (dev->stag_arr == NULL) + if (!dev->stag_arr) goto alloc_err; ocrdma_alloc_pd_pool(dev);