Commit ea5930f4e1328cad5893d4f0a90edb2ff5693206
Committed by
David S. Miller
1 parent
85d3fc9418
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
team: lb: use sizeof(*fprog) in __fprog_create
sock_fprog and sock_fprog_kern are of equal size, however it's cleaner to just use sizeof(*fprog) instead to always have correct type. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
drivers/net/team/team_mode_loadbalance.c
... | ... | @@ -249,7 +249,7 @@ |
249 | 249 | |
250 | 250 | if (data_len % sizeof(struct sock_filter)) |
251 | 251 | return -EINVAL; |
252 | - fprog = kmalloc(sizeof(struct sock_fprog), GFP_KERNEL); | |
252 | + fprog = kmalloc(sizeof(*fprog), GFP_KERNEL); | |
253 | 253 | if (!fprog) |
254 | 254 | return -ENOMEM; |
255 | 255 | fprog->filter = kmemdup(filter, data_len, GFP_KERNEL); |