Commit 642ac6c0 authored by Shraddha Barke's avatar Shraddha Barke Committed by Greg Kroah-Hartman
Browse files

Staging: wilc1000: Remove null check before kfree



kfree on NULL pointer is a no-op.

This patch uses the following semantic patch to find such an instance
where NULL check is present before kfree.

// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>smpl>

Signed-off-by: default avatarShraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 772a6e1f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2338,7 +2338,6 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)

done:

	if (buff != NULL)
	kfree(buff);

	return s32Error;