summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2017-05-08 10:50:09 +0200
committerSumit Semwal <sumit.semwal@linaro.org>2017-05-08 20:50:21 +0530
commitdb7942b6292306abd42d3340fdb57d9d80fcffd9 (patch)
tree098fad9115d5f49040d00470a4e79579225f311a
parent9eddb41dbe98b4854e64a69b686ace734c2c7aa0 (diff)
dma-buf: Improve a size determination in dma_buf_attach()
Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. 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>
-rw-r--r--drivers/dma-buf/dma-buf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 53257c166f4d..9887d72cf804 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -558,7 +558,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
if (WARN_ON(!dmabuf || !dev))
return ERR_PTR(-EINVAL);
- attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL);
+ attach = kzalloc(sizeof(*attach), GFP_KERNEL);
if (attach == NULL)
return ERR_PTR(-ENOMEM);