From: <Ajay.Kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <gregkh@linuxfoundation.org>,
<Adham.Abozaeid@microchip.com>, <johannes@sipsolutions.net>,
<Ajay.Kathat@microchip.com>, <stable@vger.kernel.org>
Subject: [PATCH 2/8] staging: wilc1000: fix error path cleanup in wilc_wlan_initialize()
Date: Wed, 26 Jun 2019 12:40:48 +0000 [thread overview]
Message-ID: <1561552810-8933-3-git-send-email-ajay.kathat@microchip.com> (raw)
In-Reply-To: <1561552810-8933-1-git-send-email-ajay.kathat@microchip.com>
From: Ajay Singh <ajay.kathat@microchip.com>
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: b46d68825c2d ("staging: wilc1000: remove COMPLEMENT_BOOT")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/wilc_netdev.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_netdev.c b/drivers/staging/wilc1000/wilc_netdev.c
index c4efec2..0e0a4ee 100644
--- a/drivers/staging/wilc1000/wilc_netdev.c
+++ b/drivers/staging/wilc1000/wilc_netdev.c
@@ -530,17 +530,17 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
goto fail_locks;
}
- if (wl->gpio_irq && init_irq(dev)) {
- ret = -EIO;
- goto fail_locks;
- }
-
ret = wlan_initialize_threads(dev);
if (ret < 0) {
ret = -EIO;
goto fail_wilc_wlan;
}
+ if (wl->gpio_irq && init_irq(dev)) {
+ ret = -EIO;
+ goto fail_threads;
+ }
+
if (!wl->dev_irq_num &&
wl->hif_func->enable_interrupt &&
wl->hif_func->enable_interrupt(wl)) {
@@ -596,7 +596,7 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
fail_irq_init:
if (wl->dev_irq_num)
deinit_irq(dev);
-
+fail_threads:
wlan_deinitialize_threads(dev);
fail_wilc_wlan:
wilc_wlan_cleanup(dev);
--
2.7.4
next prev parent reply other threads:[~2019-06-26 12:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 12:40 [PATCH 0/8] staging: wilc1000: dynamically add/delete interfaces & cleanup fixes Ajay.Kathat
2019-06-26 12:40 ` [PATCH 1/8] staging: wilc1000: handle p2p operations in caller context Ajay.Kathat
2019-06-26 12:40 ` Ajay.Kathat [this message]
2019-06-26 12:40 ` [PATCH 3/8] staging: wilc1000: added support to dynamically add/remove interfaces Ajay.Kathat
2019-06-26 12:40 ` [PATCH 4/8] staging: wilc1000: remove use of driver_handler_id & ifc_id Ajay.Kathat
2019-06-26 12:40 ` [PATCH 5/8] staging: wilc1000: remove unnecessary loop to traverse vif interfaces Ajay.Kathat
2019-06-26 12:41 ` [PATCH 6/8] staging: wilc1000: remove use of 'src_addr' element in 'wilc_vif' struct Ajay.Kathat
2019-06-26 12:41 ` [PATCH 7/8] staging: wilc1000: remove extra argument passing to wilc_send_config_pkt() Ajay.Kathat
2019-06-26 12:41 ` [PATCH 8/8] staging: wilc1000: rename 'host_interface' source and header Ajay.Kathat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1561552810-8933-3-git-send-email-ajay.kathat@microchip.com \
--to=ajay.kathat@microchip.com \
--cc=Adham.Abozaeid@microchip.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox