Skip to content

Commit

Permalink
team: lb: use sizeof(*fprog) in __fprog_create
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Borkmann authored and David S. Miller committed May 24, 2014
1 parent 85d3fc9 commit ea5930f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/team/team_mode_loadbalance.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static int __fprog_create(struct sock_fprog_kern **pfprog, u32 data_len,

if (data_len % sizeof(struct sock_filter))
return -EINVAL;
fprog = kmalloc(sizeof(struct sock_fprog), GFP_KERNEL);
fprog = kmalloc(sizeof(*fprog), GFP_KERNEL);
if (!fprog)
return -ENOMEM;
fprog->filter = kmemdup(filter, data_len, GFP_KERNEL);
Expand Down

0 comments on commit ea5930f

Please sign in to comment.