From patchwork Wed Aug 19 17:45:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 42759 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7JHkPjp023387 for ; Wed, 19 Aug 2009 17:46:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751017AbZHSRqU (ORCPT ); Wed, 19 Aug 2009 13:46:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751882AbZHSRqU (ORCPT ); Wed, 19 Aug 2009 13:46:20 -0400 Received: from xc.sipsolutions.net ([83.246.72.84]:54728 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbZHSRqT (ORCPT ); Wed, 19 Aug 2009 13:46:19 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MdpEq-0006w0-18; Wed, 19 Aug 2009 19:46:20 +0200 Subject: [PATCH] mac80211: fix register_hw error path From: Johannes Berg To: John Linville Cc: linux-wireless Date: Wed, 19 Aug 2009 19:45:50 +0200 Message-Id: <1250703950.8073.2.camel@johannes.local> Mime-Version: 1.0 X-Mailer: Evolution 2.27.90 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org "cfg80211: fix alignment problem in scan request" introduced a bug into the error path, because now we allocate the entire scan request and not just the channel list (the channel list is allocated together with the scan request) -- on errors we thus also need to free the entire scan request. Signed-off-by: Johannes Berg --- net/mac80211/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- wireless-testing.orig/net/mac80211/main.c 2009-08-19 19:44:18.000000000 +0200 +++ wireless-testing/net/mac80211/main.c 2009-08-19 19:44:20.000000000 +0200 @@ -930,7 +930,7 @@ int ieee80211_register_hw(struct ieee802 fail_workqueue: wiphy_unregister(local->hw.wiphy); fail_wiphy_register: - kfree(local->int_scan_req->channels); + kfree(local->int_scan_req); return result; } EXPORT_SYMBOL(ieee80211_register_hw);