af_unix: Pass struct sock to unix_autobind().
authorKuniyuki Iwashima <kuniyu@amazon.co.jp>
Wed, 24 Nov 2021 02:14:20 +0000 (11:14 +0900)
committerJakub Kicinski <kuba@kernel.org>
Sat, 27 Nov 2021 02:01:53 +0000 (18:01 -0800)
commitf7ed31f4615f4e1d97c0e4325c5b8a240e10073c
tree5eebee0a94017c2a9aa80b99592ad5d892585e94
parent755662ce78d14c1a9118df921c528b1f992ded2e
af_unix: Pass struct sock to unix_autobind().

We do not use struct socket in unix_autobind() and pass struct sock to
unix_bind_bsd() and unix_bind_abstract().  Let's pass it to unix_autobind()
as well.

Also, this patch fixes these errors by checkpatch.pl.

  ERROR: do not use assignment in if condition
  #1795: FILE: net/unix/af_unix.c:1795:
  + if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr

  CHECK: Logical continuations should be on the previous line
  #1796: FILE: net/unix/af_unix.c:1796:
  + if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr
  +     && (err = unix_autobind(sock)) != 0)

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/unix/af_unix.c