Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db7942b6 authored by Markus Elfring's avatar Markus Elfring Committed by Sumit Semwal
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Reviewed-by: default avatarGustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
parent 9eddb41d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);