Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1637324

[PATCH 3/4] dma-buf: Adjust a null pointer check in dma_buf_attach()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 3/4] dma-buf: Adjust a null pointer check in dma_buf_attach()
Date 2017-05-08 11:20 +0200
Message-ID <tEMZI-1ZS-15@gated-at.bofh.it> (permalink)
References <tEMZI-1ZS-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
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 <elfring@users.sourceforge.net>
---
 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;
-- 
2.12.2

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] DMA-buf: Fine-tuning for four function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
  [PATCH 4/4] dma-buf: Use seq_putc() in two functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
    Re: [PATCH 4/4] dma-buf: Use seq_putc() in two functions Gustavo Padovan <gustavo@padovan.org> - 2017-05-08 16:40 +0200
  [PATCH 1/4] dma-buf: Combine two function calls into one in  dma_buf_debug_show() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
    Re: [PATCH 1/4] dma-buf: Combine two function calls into one in  dma_buf_debug_show() Gustavo Padovan <gustavo@padovan.org> - 2017-05-08 16:40 +0200
  [PATCH 3/4] dma-buf: Adjust a null pointer check in dma_buf_attach() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
    Re: [PATCH 3/4] dma-buf: Adjust a null pointer check in  dma_buf_attach() Gustavo Padovan <gustavo@padovan.org> - 2017-05-08 16:40 +0200
  [PATCH 2/4] dma-buf: Improve a size determination in dma_buf_attach() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 11:20 +0200
    Re: [PATCH 2/4] dma-buf: Improve a size determination in  dma_buf_attach() Gustavo Padovan <gustavo@padovan.org> - 2017-05-08 16:40 +0200
  Re: [PATCH 0/4] DMA-buf: Fine-tuning for four function implementations Sumit Semwal <sumit.semwal@linaro.org> - 2017-05-09 06:30 +0200

csiph-web