ipx: Remove spurious NULL checking in ipx_ioctl().
authorDavid S. Miller <davem@davemloft.net>
Sat, 19 May 2012 04:51:04 +0000 (00:51 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 19 May 2012 04:51:04 +0000 (00:51 -0400)
We already unconditionally dereference 'sk' via lock_sock(sk) earlier
in this function, and our caller (sock_do_ioctl()) makes takes similar
liberties.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipx/af_ipx.c

index 824d4a3338ae89645528605f8de69e42cdc178a8..dfd6faaf0ea763da838c7408eca1374aeb23bdbb 100644 (file)
@@ -1901,9 +1901,7 @@ static int ipx_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                              (const unsigned short __user *)argp);
                break;
        case SIOCGSTAMP:
-               rc = -EINVAL;
-               if (sk)
-                       rc = sock_get_timestamp(sk, argp);
+               rc = sock_get_timestamp(sk, argp);
                break;
        case SIOCGIFDSTADDR:
        case SIOCSIFDSTADDR: