Commit 6419f818 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: fix error path cleanup in wilc_wlan_initialize()

For the error path in wilc_wlan_initialize(), the resources are not
cleanup in the correct order. Reverted the previous changes and use the
correct order to free during error condition.

Fixes: b46d6882 ("staging: wilc1000: remove COMPLEMENT_BOOT")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 424a6112
...@@ -530,17 +530,17 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) ...@@ -530,17 +530,17 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
goto fail_locks; goto fail_locks;
} }
if (wl->gpio_irq && init_irq(dev)) {
ret = -EIO;
goto fail_locks;
}
ret = wlan_initialize_threads(dev); ret = wlan_initialize_threads(dev);
if (ret < 0) { if (ret < 0) {
ret = -EIO; ret = -EIO;
goto fail_wilc_wlan; goto fail_wilc_wlan;
} }
if (wl->gpio_irq && init_irq(dev)) {
ret = -EIO;
goto fail_threads;
}
if (!wl->dev_irq_num && if (!wl->dev_irq_num &&
wl->hif_func->enable_interrupt && wl->hif_func->enable_interrupt &&
wl->hif_func->enable_interrupt(wl)) { wl->hif_func->enable_interrupt(wl)) {
...@@ -596,7 +596,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif) ...@@ -596,7 +596,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
fail_irq_init: fail_irq_init:
if (wl->dev_irq_num) if (wl->dev_irq_num)
deinit_irq(dev); deinit_irq(dev);
fail_threads:
wlan_deinitialize_threads(dev); wlan_deinitialize_threads(dev);
fail_wilc_wlan: fail_wilc_wlan:
wilc_wlan_cleanup(dev); wilc_wlan_cleanup(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment