diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2018-09-11 09:42:15 -0400 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2018-09-12 02:21:33 -0400 |
commit | 33f35429fc49c09a5d4b929690d4c44694c390a7 (patch) | |
tree | 055a1fc3e67e2264881a473922afa682b8bfedc0 | |
parent | 7b26e4e2119d0c5ede1282b22ce2af22835ff4b5 (diff) |
udmabuf: use sizeof(variable) instead of sizeof(type)
Reported-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180911134216.9760-13-kraxel@redhat.com
-rw-r--r-- | drivers/dma-buf/udmabuf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 63cc77edd1f3..9edabce0b8ab 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c | |||
@@ -128,7 +128,7 @@ static long udmabuf_create(const struct udmabuf_create_list *head, | |||
128 | int seals, ret = -EINVAL; | 128 | int seals, ret = -EINVAL; |
129 | u32 i, flags; | 129 | u32 i, flags; |
130 | 130 | ||
131 | ubuf = kzalloc(sizeof(struct udmabuf), GFP_KERNEL); | 131 | ubuf = kzalloc(sizeof(*ubuf), GFP_KERNEL); |
132 | if (!ubuf) | 132 | if (!ubuf) |
133 | return -ENOMEM; | 133 | return -ENOMEM; |
134 | 134 | ||
@@ -142,7 +142,7 @@ static long udmabuf_create(const struct udmabuf_create_list *head, | |||
142 | if (ubuf->pagecount > pglimit) | 142 | if (ubuf->pagecount > pglimit) |
143 | goto err; | 143 | goto err; |
144 | } | 144 | } |
145 | ubuf->pages = kmalloc_array(ubuf->pagecount, sizeof(struct page *), | 145 | ubuf->pages = kmalloc_array(ubuf->pagecount, sizeof(*ubuf->pages), |
146 | GFP_KERNEL); | 146 | GFP_KERNEL); |
147 | if (!ubuf->pages) { | 147 | if (!ubuf->pages) { |
148 | ret = -ENOMEM; | 148 | ret = -ENOMEM; |
@@ -211,7 +211,7 @@ static long udmabuf_ioctl_create(struct file *filp, unsigned long arg) | |||
211 | struct udmabuf_create_item list; | 211 | struct udmabuf_create_item list; |
212 | 212 | ||
213 | if (copy_from_user(&create, (void __user *)arg, | 213 | if (copy_from_user(&create, (void __user *)arg, |
214 | sizeof(struct udmabuf_create))) | 214 | sizeof(create))) |
215 | return -EFAULT; | 215 | return -EFAULT; |
216 | 216 | ||
217 | head.flags = create.flags; | 217 | head.flags = create.flags; |