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>
return 0;
err_reg:
- if (net_eq(net, &init_net))
+ if (!net_eq(net, &init_net))
kfree(table);
err_alloc:
return -ENOMEM;