浏览代码

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 <elfring@users.sourceforge.net>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Markus Elfring 8 年之前
父节点
当前提交
34d84ec488
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/dma-buf/dma-buf.c

+ 1 - 1
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;