Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

af_unix: fix unix_sysctl_register() error path

We want to kfree(table) if @table has been kmalloced,
ie for non initial network namespace.

Fixes: 849d5aa3a1d8 ("af_unix: Do not call kmemdup() for init_net's sysctl table.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
44ac441a be587adb

+1 -1
+1 -1
net/unix/sysctl_net_unix.c
··· 43 43 return 0; 44 44 45 45 err_reg: 46 - if (net_eq(net, &init_net)) 46 + if (!net_eq(net, &init_net)) 47 47 kfree(table); 48 48 err_alloc: 49 49 return -ENOMEM;