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: 9715927 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 72D9B60364 for ; Mon, 8 May 2017 09:13:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54AB422B39 for ; Mon, 8 May 2017 09:13:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47D5B26E78; Mon, 8 May 2017 09:13:21 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D855622B39 for ; Mon, 8 May 2017 09:13:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6711D6E209; Mon, 8 May 2017 09:13:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.17.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5ED1E6E209 for ; Mon, 8 May 2017 09:13:19 +0000 (UTC) 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 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 Cc: kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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;