diff options
author | Alex Dewar <alex.dewar90@gmail.com> | 2020-09-26 18:45:58 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2020-09-29 11:25:30 +0300 |
commit | 1d2a85382282e7c77cbde5650335c3ffc6073fa1 (patch) | |
tree | c589b3dffd511b86cc91cc9aed9517963fb5e1ca /drivers/net/wireless/wl3501_cs.c | |
parent | 42af278bff023a0bc852cb2c2758da72ed3e85cc (diff) | |
download | lwn-1d2a85382282e7c77cbde5650335c3ffc6073fa1.tar.gz lwn-1d2a85382282e7c77cbde5650335c3ffc6073fa1.zip |
wl3501_cs: Remove unnecessary NULL check
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200926174558.9436-1-alex.dewar90@gmail.com
Diffstat (limited to 'drivers/net/wireless/wl3501_cs.c')
-rw-r--r-- | drivers/net/wireless/wl3501_cs.c | 4 |
1 files changed, 1 insertions, 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, |