From patchwork Mon May 8 09:13:16 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: 9715931 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 9B8D660364 for ; Mon, 8 May 2017 09:13:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FA2A22B39 for ; Mon, 8 May 2017 09:13:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 746C026E78; Mon, 8 May 2017 09:13:35 +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 0BC6C22B39 for ; Mon, 8 May 2017 09:13:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753792AbdEHJNY (ORCPT ); Mon, 8 May 2017 05:13:24 -0400 Received: from mout.web.de ([212.227.17.12]:65408 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751465AbdEHJNW (ORCPT ); Mon, 8 May 2017 05:13:22 -0400 Received: from [192.168.1.3] ([77.182.37.117]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MaJro-1dRX3l0mQy-00JtK3; Mon, 08 May 2017 11:13:17 +0200 Subject: [PATCH 3/4] dma-buf: Adjust a null pointer check in dma_buf_attach() From: SF Markus Elfring To: dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, Gustavo Padovan , Sumit Semwal Cc: LKML , kernel-janitors@vger.kernel.org References: <3d972fa2-787a-d1f2-ff86-5c05494e00d3@users.sourceforge.net> Message-ID: <1deb58e7-7eac-55d6-235a-baf72f392371@users.sourceforge.net> Date: Mon, 8 May 2017 11:13:16 +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: <3d972fa2-787a-d1f2-ff86-5c05494e00d3@users.sourceforge.net> Content-Language: en-US X-Provags-ID: V03:K0:VJjmF27QFsO41yXitp/Xa8isr2WsYazR96xHQDZeB8eLKod1+sq CvrIMlMMaW6NsnyYqEXTWxGordceSSTGsh/hPCOpO2BxXIT38UzsJpDLWIcLjw2ZRKM2yES RlCH2Mlkia02r6C4XlAptvkkclXWL2i9KWWAiymXsASt3fXCtNt9MMwCUFiLOis9ys8lAod 705BRxOtKXhNLULmXlIZA== X-UI-Out-Filterresults: notjunk:1; V01:K0:Hf+yRw5lgec=:YzyEXtzFUUtnHycWa5nulh c01OQ8K0i74e+KqiuJ4XQNJoH7p5g9Mzb8RvkSvDIuYbb10HUvkIgxcXuqSjvFRU/tK+FyT2F J/a3nrTybIlqRYuxL6+5++ZMzq+5Il9a4Z0ntAWc8glM8A+9FZ63VsMKdkT4gKYtWThBlP8W7 GJYGwEQB7YOdQTQWK15kHQz9PRHHPHwCt3cF2T948SNZWb6b0ms2yCJPl96vTFA8TA172dVfk dboUQJtI3qYs532kWfkU0bKaqFu3vVgcbSGXjVlJkT3/hsOHaKSA6ioFdyUSdwrDAP8Mzl7Iq x0P3DHeIC4ZEbtTS+CPEQiJ5wYLCOHYSooPFgy124qtyE62A1/68/UV1BUvv8+mLr6FqBcwCe 0Y6dZgkDbcCOiKqMFdT44CPg4LezWs+cJw1bxhI/J3lH0eon2pG6eNOBcMt0UZGaqEs0ffxzP poVgTvjwqR0Ivc4UzlbTNuqqgWxmZ1bIhvm2OGzT91+kNpm0ysKvPs+9tk1V9cN2ynwUTUJW/ UBApR4NC8BlwjO6ioOsJenkHEOIuXwp791EqFY5xttjYqAvsuJ8ukUpcVgqsg7gQ86iwia4KW G1K/HozDmSHl8+EuCAxpUqPwmxsdd54gDTMgUbl60MvU99rFFquillp+7zuQtqjjbpWAKKVj1 O9QlxNUbpF0YlmCS+Zw3b1WzV0KtIiGbJmDP1EyJuJFPwod8pt/RVgFruxzc94FO+ZOMRyp+L O3zDOZEvsRJcmtGgAXYpIN3KRUCo5UfzvRl1zWsRCmgEO6L2/JmrLN1AgHTk3i+rwITB3vey4 cGY3p1E 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: Mon, 8 May 2017 10:54:17 +0200 The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written "!attach" Thus adjust this expression. Signed-off-by: Markus Elfring Reviewed-by: Gustavo Padovan --- drivers/dma-buf/dma-buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 9887d72cf804..4a038dcf5361 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -559,7 +559,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, return ERR_PTR(-EINVAL); attach = kzalloc(sizeof(*attach), GFP_KERNEL); - if (attach == NULL) + if (!attach) return ERR_PTR(-ENOMEM); attach->dev = dev;