提交 9e4aee43 编写于 作者: D Dan Carpenter 提交者: Kalle Valo

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 97276c10
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册