2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 12:43:55 +08:00

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>
This commit is contained in:
Markus Elfring 2017-05-08 10:50:09 +02:00 committed by Sumit Semwal
parent 9eddb41dbe
commit db7942b629

View File

@ -558,7 +558,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
if (WARN_ON(!dmabuf || !dev)) if (WARN_ON(!dmabuf || !dev))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL); attach = kzalloc(sizeof(*attach), GFP_KERNEL);
if (attach == NULL) if (attach == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);