Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea5930f4 authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 85d3fc94
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -249,7 +249,7 @@ static int __fprog_create(struct sock_fprog_kern **pfprog, u32 data_len,


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