* [patch] hostap: fix an error code in prism2_config()
@ 2015-12-04 13:17 Dan Carpenter
2015-12-11 11:22 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-12-04 13:17 UTC (permalink / raw)
To: Jouni Malinen; +Cc: Kalle Valo, linux-wireless, kernel-janitors
The current code returns success if prism2_init_local_data() fails, but
we want to return an error code. Also we can remove the bogus
ret initializer because it is wrong and never used.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/wireless/intersil/hostap/hostap_cs.c b/drivers/net/wireless/intersil/hostap/hostap_cs.c
index 50033aa..74f63b7 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_cs.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_cs.c
@@ -473,7 +473,7 @@ static int prism2_config(struct pcmcia_device *link)
struct net_device *dev;
struct hostap_interface *iface;
local_info_t *local;
- int ret = 1;
+ int ret;
struct hostap_cs_priv *hw_priv;
unsigned long flags;
@@ -502,8 +502,10 @@ static int prism2_config(struct pcmcia_device *link)
/* Need to allocate net_device before requesting IRQ handler */
dev = prism2_init_local_data(&prism2_pccard_funcs, 0,
&link->dev);
- if (dev = NULL)
+ if (!dev) {
+ ret = -ENOMEM;
goto failed;
+ }
link->priv = dev;
iface = netdev_priv(dev);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: hostap: fix an error code in prism2_config()
2015-12-04 13:17 [patch] hostap: fix an error code in prism2_config() Dan Carpenter
@ 2015-12-11 11:22 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2015-12-11 11:22 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Jouni Malinen, linux-wireless, kernel-janitors
> The current code returns success if prism2_init_local_data() fails, but
> we want to return an error code. Also we can remove the bogus
> ret initializer because it is wrong and never used.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-11 11:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-04 13:17 [patch] hostap: fix an error code in prism2_config() Dan Carpenter
2015-12-11 11:22 ` 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).