atheros: release sock_raw and reset appfilter on hapd_init failure

Submitted by Baruch Siach on Nov. 12, 2012, 3:46 p.m.

Details

Message ID cdd452925ee2ed8edf1379bfc06eb089c07b1e92.1352735124.git.baruch@tkos.co.il
State Accepted
Commit 50d405ec87a125af1f16a0baa58d225eebe5d1fe
Headers show

Commit Message

Baruch Siach Nov. 12, 2012, 3:46 p.m.
Signed-hostap: Baruch Siach <baruch@tkos.co.il>
---
 src/drivers/driver_atheros.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Jouni Malinen Dec. 25, 2012, 11:51 a.m.
Thanks, applied.

Patch hide | download patch | download mbox

diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
index a0a5210..4d87135 100644
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -1688,13 +1688,17 @@  atheros_init(struct hostapd_data *hapd, struct wpa_init_params *params)
 	linux_set_iface_flags(drv->ioctl_sock, drv->iface, 0);
 	atheros_set_privacy(drv, 0); /* default to no privacy */
 
-	atheros_receive_pkt(drv);
+	if (atheros_receive_pkt(drv))
+		goto bad;
 
 	if (atheros_wireless_event_init(drv))
 		goto bad;
 
 	return drv;
 bad:
+	atheros_reset_appfilter(drv);
+	if (drv->sock_raw)
+		l2_packet_deinit(drv->sock_raw);
 	if (drv->sock_recv != NULL && drv->sock_recv != drv->sock_xmit)
 		l2_packet_deinit(drv->sock_recv);
 	if (drv->sock_xmit != NULL)