OSDN Git Service

net: sockev: code cleanup
authorTejaswi Tanikella <tejaswit@codeaurora.org>
Wed, 11 Jul 2018 08:05:11 +0000 (13:35 +0530)
committerTejaswi Tanikella <tejaswit@codeaurora.org>
Wed, 11 Jul 2018 09:15:57 +0000 (14:45 +0530)
Replace with cleaner NULL checks. Needed for dependent change
commit 59f6fd5f1905 ("net: core: null pointer derefernce in
sockev_client_cb").

Change-Id: Icdd7a5c9f3e3f343bb20b1f9b75fa580ea75a2dc
Signed-off-by: Tejaswi Tanikella <tejaswit@codeaurora.org>
net/core/sockev_nlmcast.c

index 3d7dabe..88bb411 100644 (file)
@@ -74,7 +74,7 @@ static int sockev_client_cb(struct notifier_block *nb,
        sock = (struct socket *)data;
        if (socknlmsgsk == 0)
                goto done;
-       if ((socknlmsgsk == NULL) || (sock == NULL) || (sock->sk == NULL))
+       if ((!socknlmsgsk) || (!sock) || (!sock->sk))
                goto done;
 
        if (sock->sk->sk_family != AF_INET && sock->sk->sk_family != AF_INET6)