From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796297270; b=HLwYrHdJGtq4aZaxrCWjna4PFrnAkHIu6ZYmUF7o9UUZneer2nseK6leY6/YfjCZiYQq kFsW4gCFvDp+sLtbFJWktT58Aq1YC4cMmLAYxfa69AmzFrHFEmUtfTVeCckk+XSvAFWqe dbWVL69cr3bjhv9fPZ+cWJPxZe7+oMUnXEsEuiaL6gD34wLHbWjSLAmsDB/WLbYb+xQ1s NQLziBpz/o2588a3dZxGv4XfF1Eimng8AVZccZjBDcYHrgy5Q1tssLDfS2/LlvLI8tBDL OXrOxOBXTUcbhX4WZLS5o07JVf3061oSdYgcaRAeFybuZPLMkucndf5I0GqwH4Oldcg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796297270; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=IBAslRrhKbNew/3GSt+8vgGp4gcpExaxMQ47veJ7vT8=; b=Tc/ISksRDFdRbmgkGmewgapFt5pUy5HEBoEYqxN2FdjE+kdMX2NkkT/W6niibIgYfwZJ ZnH20hbdWDpkeC3M2cqL1tqre8BZkokFm61lOVgdNrzYqxFXsf2qZO01aqaWUnSwC9sqg xb70nOATaCzz948/MAXcLTuEI3zOsiarje19msSapqKtP5agui+K7r5h6NUQhJM6S7Lt2 UyWedXiYnEOIAQo300FqaRu8N1PxNrNdW/+OsnJMLlsMecKxdmkzGDYERBcKQYWihMezc PJ0VMcZqWORL8W8lNFugk5cMondkTkUhzPA9G3olxgDGab41NfHrFgsyKpPoMwV4ZcQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="bIR6Z2y/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B780C606A322 for ; Thu, 3 Dec 2026 11:27:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=bIR6Z2y/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 699381F0089A; Thu, 3 Dec 2026 11:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796297270; bh=IBAslRrhKbNew/3GSt+8vgGp4gcpExaxMQ47veJ7vT8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=bIR6Z2y/ktcC5s4nLTXuTBlcC7nP2rPjEMMuuuG0wHXXQsCidlPKr1lhQsgYXXCZ+ FFWdLxyZXyIg9Rsg4bhISntaHsGB174Kf1uuxKMmhhd0Zm1xENVV4a+UbKlD/JAiBU xQ+0h3NpA//NN4Lfb+mRXsgfKoKhe2g8Ved3z2MUr2ReGoVt2FqS16uPcDvyGR3g+s ZLlJLH0/E/wRHUeHNNV/2fS/xwmLrlfVBoLfWFIvxRTUUNkwD3gC1plnoBZJnuA0zX h9t9s5ikRzDWWCbsb//UvWrP/cMq/zPMOjiNPTisb37KB2OT1jxAmBMKRKCv5P1k0/ IOxPHcSkMaM6g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] serial: mvebu-uart: do not leave a stale port behind when probe fails Reply-To: sashiko-reviews@lists.linux.dev To: "Arina Kharlamova" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261203-v08b-v2-1-79564cfdbb46@mbzuai.ac.ae> References: <20261203-v08b-v2-1-79564cfdbb46@mbzuai.ac.ae> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 11:27:50 +0000 X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > From: Arina Kharlamova >=20 > mvebu_uart_probe() fills the static mvebu_uart_ports[] entry with the > devm mapping and the devm private data before it gets the clock and > the interrupts, and keeps them if uart_add_one_port() fails. On any of > these failures devres unmaps the registers and frees the private data, > but the static port keeps membase, mapbase and private_data. >=20 > mvebu_uart_console_setup() only checks membase and mapbase. When > another port registers the console first, for example with > console=3DttyMV1 and ttyMV1 still waiting for its clock, the setup > callback uses the stale port, accesses the unmapped registers and > dereferences the freed private data. >=20 > Keep the mapping in a local variable, test is_ext through mvuart > instead of the port, and store membase, mapbase and private_data in > the port only after the last step that can fail before > uart_add_one_port(). Clear them again if uart_add_one_port() fails. >=20 > Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700= serial port") > Signed-off-by: Arina Kharlamova Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-v08b-v2-1-= 79564cfdbb46@mbzuai.ac.ae?part=3D1