From: Markus Elfring Date: Mon, 8 May 2017 08:54:17 +0000 (+0200) Subject: dma-buf: Adjust a null pointer check in dma_buf_attach() X-Git-Tag: v4.13-rc1~73^2~30^2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34d84ec4881d1343bec8c0848fd946e3073e6612;p=thirdparty%2Fkernel%2Flinux.git dma-buf: Adjust a null pointer check in dma_buf_attach() 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 Signed-off-by: Sumit Semwal --- diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 9887d72cf804e..4a038dcf53612 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;