Return-path: Received: from rv-out-0506.google.com ([209.85.198.227]:37018 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751011AbYJVHAu (ORCPT ); Wed, 22 Oct 2008 03:00:50 -0400 Received: by rv-out-0506.google.com with SMTP id k40so2807767rvb.1 for ; Wed, 22 Oct 2008 00:00:47 -0700 (PDT) Message-ID: (sfid-20081022_090054_784916_B111DDFD) Date: Wed, 22 Oct 2008 09:00:47 +0200 From: "Rami Rosen" To: linville@tuxdriver.com Subject: [PATCH ] mac80211: check return value of dev_alloc_skb() in ieee80211_sta_join_ibss(). Cc: johannes@sipsolutions.net, linux-wireless@vger.kernel.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_22966_27556019.1224658847466" Sender: linux-wireless-owner@vger.kernel.org List-ID: ------=_Part_22966_27556019.1224658847466 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline This patch adds a check on the return value of dev_alloc_skb() in ieee80211_sta_join_ibss() in net/mac80211/mlme.c. The patch is to wireless-next-2.6. Signed-off-by: Rami Rosen ------=_Part_22966_27556019.1224658847466 Content-Type: text/plain; name=patch.txt Content-Transfer-Encoding: base64 X-Attachment-Id: f_fmlm6z7y0 Content-Disposition: attachment; filename=patch.txt ZGlmZiAtLWdpdCBhL25ldC9tYWM4MDIxMS9tbG1lLmMgYi9uZXQvbWFjODAyMTEvbWxtZS5jCmlu ZGV4IDQ5Zjg2ZmEuLjJkZDUzZWYgMTAwNjQ0Ci0tLSBhL25ldC9tYWM4MDIxMS9tbG1lLmMKKysr IGIvbmV0L21hYzgwMjExL21sbWUuYwpAQCAtMTQxNCw2MiArMTQxNCw2NyBAQCBzdGF0aWMgaW50 IGllZWU4MDIxMV9zdGFfam9pbl9pYnNzKHN0cnVjdCBpZWVlODAyMTFfc3ViX2lmX2RhdGEgKnNk YXRhLAogCiAJLyogQnVpbGQgSUJTUyBwcm9iZSByZXNwb25zZSA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nN1cHBfcmF0 ZXNbOF0sIHJhdGVzKTsKIAl9CiAKKwlpZnN0YS0+cHJvYmVfcmVzcCA9IHNrYjsKKworCWllZWU4 MDIxMV9pZl9jb25maWcoc2RhdGEsIElFRUU4MDIxMV9JRkNDX0JFQUNPTik7CisgCisKIAlyYXRl cyA9IDA7CiAJc2JhbmQgPSBsb2NhbC0+aHcud2lwaHktPmJhbmRzW2xvY2FsLT5ody5jb25mLmNo YW5uZWwtPmJhbmRdOwogCWZvciAoaSA9IDA7IGkgPCBic3MtPnN1cHBfcmF0ZXNfbGVuOyBpKysp IHsK ------=_Part_22966_27556019.1224658847466--