diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-12-04 16:17:46 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-12-11 14:22:04 +0300 |
commit | 9e4aee43dc2211a976f8aa7df5cf823d7a4ae640 (patch) | |
tree | 05fc8f785f403e913f307f9e47004d5d85e0ba76 /drivers/net/wireless/intersil | |
parent | 97276c10cb45380ba5d5772b616fc33b55b5bf40 (diff) | |
download | linux-9e4aee43dc2211a976f8aa7df5cf823d7a4ae640.tar.xz |
hostap: fix an error code in prism2_config()
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/intersil')
-rw-r--r-- | drivers/net/wireless/intersil/hostap/hostap_cs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/intersil/hostap/hostap_cs.c b/drivers/net/wireless/intersil/hostap/hostap_cs.c index 50033aa7c7d5..74f63b7bf7b4 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); |