From patchwork Thu May 23 03:18:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: YanBo X-Patchwork-Id: 2604551 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1F45D40077 for ; Thu, 23 May 2013 03:18:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756717Ab3EWDSG (ORCPT ); Wed, 22 May 2013 23:18:06 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:38558 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756346Ab3EWDSF (ORCPT ); Wed, 22 May 2013 23:18:05 -0400 Received: by mail-pb0-f45.google.com with SMTP id mc17so2391193pbc.32 for ; Wed, 22 May 2013 20:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2LMi1uW0cpw6mMm0pfkbpkVl3Z5/kWiE7OHiC1brlM8=; b=dIHfkt2dQfTq1u3GFQHJyVmedOrjazCLsyzROWBLyEeG8wjOcZlM/VCgtUhtkfSNgg dxeum6+SKO2vUVxY2ONwxBRMK6GwCoPAUf7LJAjINSknQwAKQ5InrwvFxtcMJQD5G4OM NowGXOKZsIGIPRzZaLWjgFIEPeDysO6CP8VfvWOgBENg1LtSkr1LJgNOeraKzly7iLCI LRtH43k02MXlcEgOfvN16HYdXZfj5fDzwgHr6gy1bwxLm0mFQktCHwDSN6os6tnOS/5A YnZ8H/khSg/ds7TEQV1tRm4baYXwhDPpw9giSK2JEAUSbJYGCylxsHbGmMbpxu+N6fMh OorA== MIME-Version: 1.0 X-Received: by 10.68.99.163 with SMTP id er3mr10942799pbb.36.1369279085349; Wed, 22 May 2013 20:18:05 -0700 (PDT) Received: by 10.70.72.226 with HTTP; Wed, 22 May 2013 20:18:05 -0700 (PDT) In-Reply-To: <1367922058.8328.2.camel@jlt4.sipsolutions.net> References: <1367238384-26722-1-git-send-email-johannes@sipsolutions.net> <51823A0E.8020005@broadcom.com> <1367489163.8298.2.camel@jlt4.sipsolutions.net> <5182BBD4.9010701@broadcom.com> <1367922058.8328.2.camel@jlt4.sipsolutions.net> Date: Thu, 23 May 2013 11:18:05 +0800 Message-ID: Subject: Re: [RFC v4] cfg80211: Android P2P-Device workaround From: YanBo To: Johannes Berg Cc: Arend van Spriel , linux-wireless Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org After create the p2p0 wireless device. When call the cfg80211_conn_work, it will crash cause this function will use wdev->netdev which is invalid, below patch will skip the further operation when get the info if the wireless device is P2P device. please review, thanks. BR /Yanbo From: Yanbo Li Date: Thu, 23 May 2013 11:05:20 +0800 Subject: [PATCH] Add the P2P device condition at cfg80211_conn_work to avoid crash Signed-off-by: Yanbo Li --- net/wireless/sme.c | 6 ++++++ 1 files changed, 6 insertions(+) -- 1.7.9.5 -- 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 diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 8019b39..232194c 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c @@ -232,6 +232,12 @@ void cfg80211_conn_work(struct work_struct *work) list_for_each_entry(wdev, &rdev->wdev_list, list) { wdev_lock(wdev); +#ifdef CONFIG_CFG80211_ANDROID_P2P_HACK + if (wdev->iftype == NL80211_IFTYPE_P2P_DEVICE) { + wdev_unlock(wdev); + continue; + } +#endif if (!netif_running(wdev->netdev)) { wdev_unlock(wdev); continue;