netlink: Delete an unnecessary check before the function call "module_put"
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 2 Jul 2015 16:38:12 +0000 (18:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Jul 2015 16:27:43 +0000 (09:27 -0700)
The module_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netlink/af_netlink.c

index dea925388a5b7a86ba649f888fb10bb805f54edb..9a0ae7172f9271851f7a7c036e1c1980f45e5255 100644 (file)
@@ -158,7 +158,7 @@ static int __netlink_remove_tap(struct netlink_tap *nt)
 out:
        spin_unlock(&netlink_tap_lock);
 
-       if (found && nt->module)
+       if (found)
                module_put(nt->module);
 
        return found ? 0 : -ENODEV;