From patchwork Thu Aug 29 21:14:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13783884 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3720DCA0EC3 for ; Thu, 29 Aug 2024 21:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=NVjwX5s57EykyCj3jwzeWGGu7nvW5VQvysrVcXVAXdg=; b=31lQN3osH4rwI4q+rVrWdd8Ttw hUFikefEGJj7FtRIvzrIBaYQFdvWqR3MYhK8ug/ibzFdNXE+iwSCci3nsuTuidVN7qohrWvsRRvtd l5HCp+WvzCJH7ShbQyrlL5spBFmKyrENX5sHkGYPUau/osSlMik8Osid0ziHR/SlnGkSFPK5/OFBD m28tcqgexpgZBawf99OyMZJLYmaAJ5ioMAogH5VQO0PJZuHkkG8VoMbPle/jVIVKivKxBFKrtVv/Y tFLM/mm0xlLape1ung1CmdeqCyBqJzxMwK4/m8HicueXmxKdtxHqErBQBaE0aNjns8Rnx44lEvrX8 0N1DwvoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjmU1-00000003etf-3hep; Thu, 29 Aug 2024 21:15:09 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjmTy-00000003en9-1Ieo for linux-i3c@lists.infradead.org; Thu, 29 Aug 2024 21:15:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mDuLDBK/UtzTXF5MWuC0yqfD+jZD405Tgwt9dCnwskhK3gcDZiIw0CcYFHyRTxBtDwcjwj8SZM4WznhcaUda3KxpCHbXgjanb7blaKZlQVo7RzwFI2X2Kkp0r1m+6UjHpTxnyO9Nh0KyJUhozjVQBdl9eXBNlDs+D0493+H7/+XaCD+6IdY6Oalzftpvm5R3WToZXthQk3gJa3vX3mQt86HFoqUXvxFIEpG5jxRm9PZ65Std/jHT47zaJ41fHo9eCOLm+60O/a7eUpYk/ApY68y89I+d2DPFWX2/dqkESvJbL8EvWV30qPs/QMf0MIjr7ChgbrgjUS0/R/Zj8B3tOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Cww+xyydNFuIwjFox6cDRmzfODgCjih+5wH/d19iPXE=; b=Sxrf4BxuH+aW/Pb4Ixx7k+jg6DJKtDWvfp8MRVZ0zvdcx106a6bjWpPvt6QejoszlY5IiIK8em4i0n+sbWudTlseF+UPsLFBZGJwz+I+FKCl2389OmXCgTohrYGBEI6d5oDEU2fT0DEvWAxggJdRAkllvfBnSFRxaFRVHpDH7BXUDwqc54ZiRiBRRE/+GRFv2vQHpl4RPXTzUhQ0ugAiIyS0voytO7XDKpt92uHMKM4OwTr1nzzGhflvR+xfN1ibVg+kSwDpzAk79dxO5IZyFAA8sZfLNKJIYIb5gEwr0/v6CbNDSMZu19pIBXOd+QQTHsfSGOl7/DvXYnZO7KQJ/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Cww+xyydNFuIwjFox6cDRmzfODgCjih+5wH/d19iPXE=; b=ZfQEBH3MVlHW46+fBA/D6gatcGMuJ9IIbEJt0LzCNW03Nj19CYPHh+uRzF9P1KLP1xzodzCb/jx7nyY9ZzBY1PwHMkANJcOW39xr6nVK7XbSV3Ndt7BLsCXP9jyBT4jSgWmNIkVD4Ihtr16R0JwDfPSQ+6uQbk9jMSnHB88pEDX+lusWBgwMQqiquC8zLe2josFmk13bFqFIy3t5y1U7gHDmtiRbtbEfaNOX7cEDW+Wuo712YPI4MQWYZoInMGqNGhneubSkcUKQny7ZKOIYfrNPT/DCk2j6X8h7QdIoX+4XDJlq5QVztcSvMJT3E9zO5gtpmStHopsuwLvXi5/obg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by AS8PR04MB7560.eurprd04.prod.outlook.com (2603:10a6:20b:29d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 21:15:02 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024 21:15:02 +0000 From: Frank Li Date: Thu, 29 Aug 2024 17:14:02 -0400 Subject: [PATCH v4 05/11] i3c: master: Fix miss free init_dyn_addr at i3c_master_put_i3c_addrs() Message-Id: <20240829-i3c_fix-v4-5-ebcbd5efceba@nxp.com> References: <20240829-i3c_fix-v4-0-ebcbd5efceba@nxp.com> In-Reply-To: <20240829-i3c_fix-v4-0-ebcbd5efceba@nxp.com> To: Alexandre Belloni , Boris Brezillon , Parshuram Thombare , Greg Kroah-Hartman , Boris Brezillon , Arnd Bergmann , Miquel Raynal , Conor Culhane Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Frank Li , stable@kernel.org X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1724966083; l=1199; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=ri9MIXRiXjqbTg39R5FGovPrvPxflLRVfGXm3ZFPAs0=; b=bMB3QWwqqCes9ly5xS1nICwxaxtWpDAE97V0FjkwcTPA6PrPPoAcKO0qlBcqGKXgJKiF44FnC J74G2fbImxACxUkY7APZ4cT0Ir63tCQoyWBBD+OG7Jzs1B96140vM46 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0219.namprd13.prod.outlook.com (2603:10b6:a03:2c1::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AS8PR04MB7560:EE_ X-MS-Office365-Filtering-Correlation-Id: 80eecb20-d659-453b-e440-08dcc86fa59f X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|52116014|7416014|38350700014; X-Microsoft-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0rt7PriDqZUdRfGdL1huf9Iw1V8JBZK2RWNDU8ye4UhDbF?= =?utf-8?q?/b8lVYFkUsrfHBwGziI6wgubJ0mfnBfga3mQtIVSxTt9+x03xn0yDwMjGWxH7bC1E?= =?utf-8?q?7e0CGAMMhkWavlyAw80TIQtU7BdYyMBDJObO9dv/n0ER6Lad9nSrY9dUc4QQSLvo/?= =?utf-8?q?yxjvy3hvzPKbhbRdgUEqjv3Pi0NxVSO+CD/Zh+DBlQsz6t4LCyraIEYy6qRAkz1Ol?= =?utf-8?q?OPW4uPlOgmf7H3ssmUxEmJh546hoZk90FGObTHv1S6NPfIwfhiVhyZHxJaO+OuJCJ?= =?utf-8?q?YyIH87yqzneyFvS4WhRzo77DASnIm0uqv5WSidWTjKlpfS/TL5rvHmrHgYJWQukSb?= =?utf-8?q?MdiYCKA+GkFAcHVPkl4aG1anHSs2IGGqtxLJ/0T9qwslXl2euRQcBMHOC8WMHHWeo?= =?utf-8?q?BNkzCyyPTyIXeCYJFFDXPJIDGjDM79R/6Ps1DqhOd0DmogilKsSBYcxsnkYIbEahb?= =?utf-8?q?Mvg9e5l4WTgCmaaJLNfsQ+2uYaOV1OPAtw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(7416014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?vy7yvcNYG+6AcsOZ4BHZOXLQdReN?= =?utf-8?q?2r7PLabbhEuv4AMeXhluGOZQI+Gy4WTkZ0AFY6T2C/Wpa9nbXS4+BY7Pr+8+TdE+a?= =?utf-8?q?kkD+1tvpggdYAOSKeWh0oVFuajUAI731U2VZWyZjV9DGo9XsCEzmkU5CbCFs5RvMm?= =?ut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=?utf-8?q?3AdPoE8CNh/7vKyIO3lEPi/yi+7vhhWNLUzTwRieTlG76sYHgYn+Ui33tKJIfkCWY?= =?utf-8?q?odMO3wp8qei+3qpUb+bY06L+C3BEZiaxYxZc3edlOllHQxhSBd1B0xqqCLmklEx26?= =?utf-8?q?5CUFGCg016ckaZZMWyfXOGNpuDl7yMNmURFJB3vIweajukP07ZxvV6BRMl3XCLjq4?= =?utf-8?q?zYvOQQPohX8VL1xhePPhATnZumpaKyacXU2S4GMABiMXT9szaV+THhB7VL7hvUnKs?= =?utf-8?q?yoPucogNt5gvHNosd+17m87pQn0ai/bskboSecLLDKVjeaD/Dzh8t772xW6aNok1C?= =?utf-8?q?Fz2scDCbJDl4piim7C6C37u91TSUbRtkNw9WZ+U8nzSFEAGrGAhF8cjmx6fTx9YFR?= =?utf-8?q?eL3mk2gHxKMMvm/UEl87qdQMO3LmXdyM4x0Io6Ckw6RJ6nZ7j9Bq/k4TnjxcOzNci?= =?utf-8?q?sQMAMQ02VIzrWc+LFvjvjfJQjzPp5B1O1lxONE3qDVoaM6O0avUZch5oSBAFVpNeE?= =?utf-8?q?s2nY3hLD1rzg?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80eecb20-d659-453b-e440-08dcc86fa59f X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 21:15:02.6456 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hD8RoeLWP55uPBlTG/xBVidqGl3HzXBtezCYHt4WCcyYPWXsWQPWwubX2yw59+EO68KxLZRtmrvQSH6+WaJcLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7560 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_141506_387203_E9C3320C X-CRM114-Status: GOOD ( 11.27 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org if (dev->boardinfo && dev->boardinfo->init_dyn_addr) ^^^ here check "init_dyn_addr" i3c_bus_set_addr_slot_status(&master->bus, dev->info.dyn_addr, ...) ^^^^ free "dyn_addr" Fix copy/paste error "dyn_addr" by replacing it with "init_dyn_addr". Cc: stable@kernel.org Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure") Reviewed-by: Miquel Raynal Signed-off-by: Frank Li --- change from v3 to v4 - mention copy/paste error - Add Miquel's review tag --- drivers/i3c/master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 7c8fc4378b979..e7cbfaf13b599 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -1467,7 +1467,7 @@ static void i3c_master_put_i3c_addrs(struct i3c_dev_desc *dev) I3C_ADDR_SLOT_FREE); if (dev->boardinfo && dev->boardinfo->init_dyn_addr) - i3c_bus_set_addr_slot_status(&master->bus, dev->info.dyn_addr, + i3c_bus_set_addr_slot_status(&master->bus, dev->boardinfo->init_dyn_addr, I3C_ADDR_SLOT_FREE); }