From patchwork Mon Nov 12 15:46:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 198415 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 761952C007D for ; Tue, 13 Nov 2012 02:47:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 63EAA9C195; Mon, 12 Nov 2012 10:47:02 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tnB+auWwPfoU; Mon, 12 Nov 2012 10:47:02 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 496AC9C1B8; Mon, 12 Nov 2012 10:46:58 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 020769C1B8 for ; Mon, 12 Nov 2012 10:46:57 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yW+MYboK+Pkb for ; Mon, 12 Nov 2012 10:46:51 -0500 (EST) Received: from sivan.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4E2D09C195 for ; Mon, 12 Nov 2012 10:46:51 -0500 (EST) Received: from sapphire.alvarion.com (taragon.tkos.co.il [10.0.4.3]) by sivan.tkos.co.il (Postfix) with ESMTP id 49239B4F7B; Mon, 12 Nov 2012 17:46:48 +0200 (IST) From: Baruch Siach To: hostap@lists.shmoo.com Subject: [PATCH] atheros: release sock_raw and reset appfilter on hapd_init failure Date: Mon, 12 Nov 2012 17:46:21 +0200 Message-Id: X-Mailer: git-send-email 1.7.10.4 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Signed-hostap: Baruch Siach --- src/drivers/driver_atheros.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)