summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2014-05-24 21:47:46 +0200
committerDavid S. Miller <davem@davemloft.net>2014-05-24 17:06:38 -0400
commitea5930f4e1328cad5893d4f0a90edb2ff5693206 (patch)
tree535f8378c85331d0b54e5877eb38cdd17339fb30
parent85d3fc9418dc5b357290de89b99c9a8bdd9eef89 (diff)
downloadop-kernel-dev-ea5930f4e1328cad5893d4f0a90edb2ff5693206.zip
op-kernel-dev-ea5930f4e1328cad5893d4f0a90edb2ff5693206.tar.gz
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>
-rw-r--r--drivers/net/team/team_mode_loadbalance.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
index 0a6ee07..a58dfeb 100644
--- a/drivers/net/team/team_mode_loadbalance.c
+++ b/drivers/net/team/team_mode_loadbalance.c
@@ -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);
OpenPOWER on IntegriCloud