From patchwork Mon Sep 13 13:01:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 510237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D291DC433F5 for ; Mon, 13 Sep 2021 13:03:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE2E960E8B for ; Mon, 13 Sep 2021 13:03:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240140AbhIMNEu (ORCPT ); Mon, 13 Sep 2021 09:04:50 -0400 Received: from mail-bn8nam08on2055.outbound.protection.outlook.com ([40.107.100.55]:54369 "EHLO NAM04-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S240067AbhIMNEV (ORCPT ); Mon, 13 Sep 2021 09:04:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a7HISlX22YxMZU18Zp6QE3BWUptiWo8oCmicrXS8QGpA6EqW2WJG9J9+gY2EyQanuIZbC0QJxC8eCcn906+wRNb5vepLGMHTLeWISm5Ri7RNrBWjz1TX6yIFbyufGttSWCFdptivjObYR259zFmNU5zZQqQkBOh9jDsQClIQfZRhjNFD5QDztcf1TUOeVVg2bMv/x0rkL2sZaOA4PKYM+6+zB3FlimNxbOUHs3nxiO1otttjkozTcaieqcnM/4T+sIn985qASah1Z3+G9D0F+0U8ILnbEymgs8mWwXmFdRVn95fsFBoB2X4y0II/8BDdPfxwWQsACRYNU2unGec5Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=WhyYy1P7KsKUgLuM2glALRDRuLVP6X8mHvwirJcSluQ=; b=KVsCJek+lwXSQIunXEQdCqUF2OgmNQWqpyR/bdgCa/+JQRGdktHd4rrbZEnDD2O22zvsQ1jZ/NHTySYYdEP6G7NYSEiI6AdY24bC8utymQgJtrhK83Qu6dKL+bqRIIWTiAq754YvRM9H/cdd+Qs+7xVR3/Zws/IX6GAIK1THhrRl6kj1zaNR+i3qvuQ8XIAPOlY/DObi7U56SqI1F/yChGYqDrMO8jTo+GYmlD5icyPTX+B2cFhxLRVCJZFitStN/xiYtWrvPSGMlabpjaR0mxbHzrdAlaeCPnqo3/aKrqJgB22hXffafvcUKGzLnUX/mys7KLzjIN+lmbY1HgfUnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WhyYy1P7KsKUgLuM2glALRDRuLVP6X8mHvwirJcSluQ=; b=AN8KwaDDkgddg10s8IlarCJA0OJQo4+8Rpb4zqD8jQjgmluvIwUDnSQJaZ93CqeFp4v6YmDb02wkAvHjEu1S/e12oa+4Xro2ao688iI4MkN5fi62Of/nW1yZx6V81zdm0h6FJ1J4d45fEaJGA8+mYvHzXxFFYEGfVK2YiSeVO5s= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none; driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SA2PR11MB4860.namprd11.prod.outlook.com (2603:10b6:806:11b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Mon, 13 Sep 2021 13:02:39 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::7050:a0a:415:2ccd%7]) with mapi id 15.20.4500.017; Mon, 13 Sep 2021 13:02:39 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v3 12/32] staging: wfx: simplify API coherency check Date: Mon, 13 Sep 2021 15:01:43 +0200 Message-Id: <20210913130203.1903622-13-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> References: <20210913130203.1903622-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 Received: from pc-42.silabs.com (37.71.187.125) by PR2P264CA0021.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 13:02:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fcb17302-af69-4ea4-8bbe-08d976b6c40a X-MS-TrafficTypeDiagnostic: SA2PR11MB4860: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h2rygBA5DJaX3wB+qdIjIOv24nuplhL6f0FDrXiVD5jnvYw9nC+G5XYe1ddVOqmnup+TXV9t+Fzaqi6FSxKn4+w416ku37qXrZke6jhwcBfys9zYYCjUQDDe+6R9PYCwxwsEsNjnepD8ccSRG8GAMbG2FIaBop9da8RphZyIvpBVkZLZ5caDNlv5IT900hmpCq6eO/uIdNud39bMEnrPKM09D0vweBfjDytIjVPxGNR/2nj9OC+/Gt433+RFdNquIUDlxdQjPhxnnVZ5xuaRFMT4hDIInQEtgMekk02ViX0Z2W5wH9R5MMg4pTx6kKFFXuMi8c//hfXHATandik781wltOLH3JI9SnvJXu8T3T0OS+YWYfeBAT56zbfhthbIL4aBCbUMkSlC0V4XiYi4h/n7N7vwLHoVMRCSy7fVu420UnPjcgVWiYAagL/H3eVTKMcjomMJMfuexijP9CestqJGZ2/0a5vxM0sbSU8lvWEIjSjUY/1Zwht7UwBahg/eKCdHVcH8XQeLHxDyjJBhsHVjh29TnPgtQvYV2K0g5pZtSPAObw8vRqvyHsPnSv/dyBjq1ndlb3M6rtoZHPtW8pplJfquLY8Ki4ik6P7Orly+SeQ6ZZ5GEzN/KTCWhV0v0Elcg+pDYP2LcwLA7TSY3ijFO8+82v0BweyqwuOTLFOJp0fGPSo99Kcv0j9Hru/lrRmvAlvPkEMat2JZ6xsyJA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB2718.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(956004)(66574015)(6666004)(66946007)(2616005)(26005)(36756003)(38100700002)(38350700002)(316002)(4326008)(107886003)(7696005)(54906003)(5660300002)(52116002)(66556008)(1076003)(66476007)(6486002)(508600001)(8936002)(83380400001)(86362001)(2906002)(8676002)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?U1wo5VDK5oyicty+e1nJGyRh6?= =?utf-8?q?9ZMbtNLnS5Ua/EDJP+PTl3xnCGEKC4WmRYFJH5cvB0+hJwrxm3ZfOB2G?= =?utf-8?q?XWY7/6VicQtAS0vhu7ujWOwrvIvRWstmpabDyoqSsPRWPyR7LSdEioLb?= =?utf-8?q?8ItXosXUEoeVmrBC8kJxsSZ11DHmAwRE2F9yM0O44IRAkuAhjGT2Sk05?= =?utf-8?q?xFGnTG9VOIhCiNmG6pnsd6WEKZSGtjqQ8JItIl6qaqgqztUJVeZK4E4B?= =?utf-8?q?FB7WcgMq3lzKrXN8wQbzT0HmEX9Ob7OiRlGByNPGjj9izdoloOHlJy4k?= =?utf-8?q?4Ct+nA2zXSHjZQmWBI9KZqKubzWx1UuBGxX7Sq+kOtgv8SaVqbq6V/Es?= =?utf-8?q?S0czblat43XQ+Su5WI9lbqMRSujXyU/0Xjdpy9lMqpOre3YuwQ4U5U2M?= =?utf-8?q?CXExMrmEG0jo+0c1exGprU4xpYH9nilGf8nkoMTgRxzQMeWIOLvYdKDI?= =?utf-8?q?mNKQkbDXOOKUlFZql9IGZcGRDx7GOjDVuZIg8+P76rUfSFECKwIjAi0f?= =?utf-8?q?UhUvEsJHVzBs8VCoR8a3ZU5KZR5xd67N8aKwiscTm8GzT0/gua4qxD/6?= =?utf-8?q?jpXEiPLhXl0rxkAFaWAyTF5pOabkZJd6asR4tykkbut8KkW/xl5BP2A6?= =?utf-8?q?zx9s1rEmxZ551ECFc/D+xwjjm5l8Lk/TGEvEKgRyUpOSELz0Ctx4XgZf?= =?utf-8?q?XJo24o3r9y/sO3arVWDqw/P+hhL5hXsAaKGp2DeAvRDHSc0dMLKPLTua?= =?utf-8?q?/OSvBOMRoj0PTsD0qWEm/S2z8fh7KbUUC/3NChSjzAppHZNWWVG460K2?= =?utf-8?q?pWoj2iGhwduFJjvnjZHj91BKf1mRRw4uCrXBw7l3VK0at55U3FVKcOjs?= =?utf-8?q?xLJthuKDgekmvFJhlU8fRmxmawC3Euzd3B5YM7thhRKsPeTHudZBKJwU?= =?utf-8?q?4/q477THZKq74IF9sL+KjSrYaMaaovNR30WtUdTnGVwdlor6pLqrsssR?= =?utf-8?q?sHKXCvBnVIpIVWa+G1VEkhk5jJs2RnzuuPoUB5Iv5hnnZgHESfa1esMB?= =?utf-8?q?048IhS7x71bXpZD/7aLldGnfRk/p1jfOYrQx3k4Hr2fTFO1drmaCpJvq?= =?utf-8?q?Ymrrw5iJyYuYAec0h0OAjoakU9bkmzeSJ8tuvDDvqRloLMChXqQ+EhVM?= =?utf-8?q?vIpQcko3UBhBNgs3vVExEgA8gG238NhLJ/ymuqwF0o3KH2EZX/Nd+op+?= =?utf-8?q?Mtg9XyDbEefpFp0Kc+AMmL5ENSAnlN0gxSd/KZNPQn+Kg2DVQR23Okq6?= =?utf-8?q?71A6CqtI7nYew6AQFJbik9FYxa0Zh9aMkOhiuh7eapgaVjL8Tl9Tw814?= =?utf-8?q?u4JHpOAnHUNOmL0ObBPtdmoNZUC4IFY?= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcb17302-af69-4ea4-8bbe-08d976b6c40a X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 13:02:39.6705 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9K0bN7KGEDVdHc8QXvmyWYQZKwJYTRQ9TrsaBi6r262lABR2QEp/ta6afZ0jIX+ArUX/AVPnNbP5xd5qd8SWZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4860 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The 'channel' argument of hif_join() should never be NULL. hif_join() does not have the responsibility to recover bug of caller. In current code, if the argument channel is NULL, memory leaks. The new code just emit a warning and does not give the illusion that it is supported (and indeed a Oops will probably raise a few lines below). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 14b7e047916e..fcce78bb3005 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -301,8 +301,6 @@ int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, WARN_ON(!conf->basic_rates); WARN_ON(sizeof(body->ssid) < ssidlen); WARN(!conf->ibss_joined && !ssidlen, "joining an unknown BSS"); - if (WARN_ON(!channel)) - return -EINVAL; if (!hif) return -ENOMEM; body->infrastructure_bss_mode = !conf->ibss_joined;