netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wl3501_cs: Remove unnecessary NULL check
@ 2020-09-26 17:45 Alex Dewar
  2020-09-29  8:25 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Dewar @ 2020-09-26 17:45 UTC (permalink / raw)
  Cc: Alex Dewar, Kalle Valo, David S. Miller, Jakub Kicinski,
	linux-wireless, netdev, linux-kernel

In wl3501_detach(), link->priv is checked for a NULL value before being
passed to free_netdev(). However, it cannot be NULL at this point as it
has already been passed to other functions, so just remove the check.

Addresses-Coverity: CID 710499: Null pointer dereferences (REVERSE_INULL)
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
---
 drivers/net/wireless/wl3501_cs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 4e7a2140649b..026e88b80bfc 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1433,9 +1433,7 @@ static void wl3501_detach(struct pcmcia_device *link)
 	wl3501_release(link);
 
 	unregister_netdev(dev);
-
-	if (link->priv)
-		free_netdev(link->priv);
+	free_netdev(dev);
 }
 
 static int wl3501_get_name(struct net_device *dev, struct iw_request_info *info,
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] wl3501_cs: Remove unnecessary NULL check
  2020-09-26 17:45 [PATCH] wl3501_cs: Remove unnecessary NULL check Alex Dewar
@ 2020-09-29  8:25 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-09-29  8:25 UTC (permalink / raw)
  To: Alex Dewar

Alex Dewar <alex.dewar90@gmail.com> wrote:

> In wl3501_detach(), link->priv is checked for a NULL value before being
> passed to free_netdev(). However, it cannot be NULL at this point as it
> has already been passed to other functions, so just remove the check.
> 
> Addresses-Coverity: CID 710499: Null pointer dereferences (REVERSE_INULL)
> Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>

Patch applied to wireless-drivers-next.git, thanks.

1d2a85382282 wl3501_cs: Remove unnecessary NULL check

-- 
https://patchwork.kernel.org/patch/11801615/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-29  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-26 17:45 [PATCH] wl3501_cs: Remove unnecessary NULL check Alex Dewar
2020-09-29  8:25 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).