Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753343AbdCHPfK (ORCPT ); Wed, 8 Mar 2017 10:35:10 -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 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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 941 Lines: 29 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 --- 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); -- 2.12.0