From patchwork Tue Dec 19 11:28:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10123079 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD4206019C for ; Tue, 19 Dec 2017 11:29:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACEC529280 for ; Tue, 19 Dec 2017 11:29:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A15BE292A2; Tue, 19 Dec 2017 11:29:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D19129280 for ; Tue, 19 Dec 2017 11:29:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965168AbdLSL3X (ORCPT ); Tue, 19 Dec 2017 06:29:23 -0500 Received: from mail-by2nam03on0052.outbound.protection.outlook.com ([104.47.42.52]:40224 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S937682AbdLSL3T (ORCPT ); Tue, 19 Dec 2017 06:29:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=w9udZ/yE0W3oSkIsX1fZ1BHfurjnBgJ+BkdIfXFIqrI=; b=CUsuGOOj2F+XNtKfFjSN8VS4Sciknt5OE6mBeAg0dEIwrg1sK9u4BAwfKJhmbJ+nyWy7FKeuFy7UtVifn6BMhdbh7dPYMPsn8CeLqkt4QxDk4vVIwXbicLoSwGXaVow+eTqFjPXJkRIaSyzR7Tx1bzqfxGbAbFx/FQ9DrOUA93o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BLUPR05MB1923.namprd05.prod.outlook.com (10.162.224.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.10; Tue, 19 Dec 2017 11:29:17 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil Subject: [PATCH v2 01/10] qtnfmac: check that MAC exists in regulatory notifier Date: Tue, 19 Dec 2017 14:28:47 +0300 Message-Id: <20171219112856.22463-2-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171219112856.22463-1-sergey.matyukevich.os@quantenna.com> References: <20171219112856.22463-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM6PR0502CA0022.eurprd05.prod.outlook.com (52.133.16.163) To BLUPR05MB1923.namprd05.prod.outlook.com (10.162.224.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 458ddea9-6461-4ba0-07ab-08d546d3bdfd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:BLUPR05MB1923; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1923; 3:J1VssIa9HKRrJ3M4wOOY+ULPCCBRMoCtzELP9IugJ11kqE17Vv5T4G8cNxH4Iu3xmAYkbcX5F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DyRtpxJ4Eyeo8BBDCVB3uhjiyOfSxLzXJMuY2ojiKri0eh3g81eKJoq8a6WUbYa3WJ2V9ZG+CC53HEoh9YnRT+c7WX3bNfiwZv6GpqT+IieBrKX6/A0DVtVjsAjmi4XA3nhtSD93/Tg6LHlV6D/pwc0AjxjqGpGKDRABKaE8OQvSzDWLQw+YWQT/3y3rz3aBWxTEuhp1Z4wFi+agRWymHP1PRXJN0QK1QEjLrOFs7jCZjPPn5xt5A0aRl36/eNVJkph5HJbmSMya9PXtd+lOSr+vH/4q9Uteu+; 4:C5f9l3qroz1Va1kQ/eIBE/Hl3O8cFRv1K1qftNT2+kT/BM9FmRZiJtRJ08xH/pLG9r56e9R6DfucT7Qx2o0P4wHHWkzm0vPqcB/z75di+OxvMWorNayhM6RXFt1/mD978yA4VDVBXoEn3ciZm58sUCy3mdgWVrPVSOmzilr2dS6InMWmRE+muxwqLpWioFzZCo4MezUrjUtDxfvukOxkNzN8DqN5ifWafQCBM3P48BrA3KudGwuIrkXh6jS8b3JyRJ++cLcjbIcsk4rwppgylw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231023)(10201501046)(93006095)(93001095)(6041248)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011); SRVR:BLUPR05MB1923; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR05MB1923; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39840400004)(346002)(396003)(189003)(199004)(48376002)(68736007)(50466002)(59450400001)(5660300001)(2950100002)(6666003)(6916009)(316002)(52116002)(76176011)(386003)(7696005)(97736004)(51416003)(16526018)(15650500001)(16586007)(107886003)(25786009)(54906003)(4326008)(69596002)(86362001)(53936002)(2906002)(81156014)(103116003)(6486002)(2361001)(2351001)(478600001)(8676002)(50226002)(1076002)(8936002)(7736002)(81166006)(66066001)(47776003)(106356001)(105586002)(3846002)(36756003)(6116002)(305945005)(53416004); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB1923; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB1923; 23:14B6XgZPsKvU/HYfwYzkCb8Q8g1XEYNW3xhVMUJ+o?= =?us-ascii?Q?asmc7vwZIXMJ5sCEWydUx1qbHFRWdGKg90Z38H/95KTwCznLE8FCvYj85Jof?= =?us-ascii?Q?3EatbVhrCGh8apsWLbCZp0gXQP6+DA0FQCCCtoZGVkWpv6VoJZoRK6eIkfnO?= =?us-ascii?Q?eqcsGUsB/DZG4c1RM1nmQHru6+0lKDvvRf0NW09kKKQxXMatXutK6MhzyCUW?= =?us-ascii?Q?TZM6G6udgpjn8BlDeouIQcdM20LpAO8DtGcNZQq3duWGihOC46obsHelrtcB?= =?us-ascii?Q?PQmPkbQVJ0QFHlSGDXzT9Kvr5+KSSGeZZuzSMtOT+6YNUzcG3J+6zrWgHkdX?= =?us-ascii?Q?nBC1OKXjPuY/srlCioF6O2hD2M12KhD+/Izh6Vek1RXGIH7OgrTlrYIr+mTQ?= =?us-ascii?Q?rtkKpW0K5HJMWJwy2y2IWi/kQc3UzCBUBEQk0Y80E21Ks8Ow+bccr5/f/bqV?= =?us-ascii?Q?vUnFPIUAuKclZ9toxJjTCBlgtGbkNS+p3XGvhyfXhp6I1c6ckM9ZT3veNCFH?= =?us-ascii?Q?471ovexnpjU8Yjo7mF5sf5T0K3JBuNyv+DYM0rrxGHl9LvjT8TAskQDY94QO?= =?us-ascii?Q?gZJyKGlXcSj5F00M8uS47ZVJxmmvAdlmpPRgXErl2lBU/EPrUlSw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T2EEfQw/Pk0VKLEltXevGDSlXp0Xt7sLscgxTODKbaAS3MRWXS0hGy8EuSzYCDxopyn8grUxHlhF0CHiBSjBsI16h0ksL2VbsvUKH0dhziQ=; 5:24gx0N9ivy0DoTYJA8UOrpM8xgxTNjDgcDmp8wBlGtvmmWr63UE62JKeSp3WRPiAMlq08Yu8EYow4873lAVbgI/IRkHJzX7VJu+F0bIQmT/p3IO75zVruY8ECGqJNNDUKhQN1ZNM0VfJQRwRtJ9aqb1VFS9Sf9K03Z1zpqqwgmw=; 24:hlFYJ7hQ5WFgx+ohcOh9a7tfZYzVjky0xOdG/7utgz8VvZzSCQzAxoam8yKNVp/YXlzqne6AW/+uyWs0pUbC/y6NUZ2cXUa6V0pjiK832mU=; 7:Z5Inug7cj/lNP98VMzDXoSJ1sJJk96KAcitADnULS2OaBl2o8GtzkZ0vswtZirF2RZhO/Fv5EejLqB9HRZTOuA1m8RRzatS1OGlijCdoQCEUf7G0E52FN5xX5QnhnpIzw2ImTyAETmdOqHpRSFnQt2LT5tKRgJVirojymwZf8tKqFrIO71/Od0YgtERiOv1AlwrAabofmbdKxwYrwd3tkK48AGjVPL8mWjj7otCvJjRgxaZgzekI/RskrkRyTnsH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 11:29:17.5438 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 458ddea9-6461-4ba0-07ab-08d546d3bdfd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB1923 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mitsyanko It is possible that regulatory notifier is called before MAC data was allocated. We need to verify that MAC data exists before trying to send a regulatory change event. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 6711e7fb6926..63d274c3f2f7 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -802,6 +802,9 @@ static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy_in, continue; mac = bus->mac[mac_idx]; + if (!mac) + continue; + wiphy = priv_to_wiphy(mac); for (band = 0; band < NUM_NL80211_BANDS; ++band) {