]> git.baikalelectronics.ru Git - kernel.git/commit
af_unix: fix unix_sysctl_register() error path
authorEric Dumazet <edumazet@google.com>
Fri, 8 Jul 2022 16:28:58 +0000 (16:28 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Jul 2022 11:27:33 +0000 (12:27 +0100)
commit11f6d43b00fca339957507a8c6202780c13895ae
tree23b9e4ea3def7e8462154771229d7879a98aed89
parentb85cd219c9254fe8c2e2f2abc7430ad5c52c310b
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: c120588fd9a8 ("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>
net/unix/sysctl_net_unix.c