net: Hyper-V: Deletion of an unnecessary check before the function call "vfree"
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 25 Nov 2014 21:33:45 +0000 (22:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Nov 2014 22:22:48 +0000 (17:22 -0500)
The vfree() function performs also input parameter validation.
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: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc.c

index 6b463117dcaca45f6130a0b6f4573d8946bc41ec..6fc834e4306d4b76ff4c42b42337e32008a683f0 100644 (file)
@@ -561,9 +561,7 @@ int netvsc_device_remove(struct hv_device *device)
        vmbus_close(device->channel);
 
        /* Release all resources */
-       if (net_device->sub_cb_buf)
-               vfree(net_device->sub_cb_buf);
-
+       vfree(net_device->sub_cb_buf);
        free_netvsc_device(net_device);
        return 0;
 }