Re: [PATCH] i2c: mlxbf: Fix use-after-free in mlxbf_i2c_init_resource()

Andi Shyti <[email protected]>
Newsgroups org.kernel.vger.linux-i2c,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <[email protected]>
Hi Xuanqiang,

On Tue, Jul 14, 2026 at 11:08:08PM +0800, Xuanqiang Luo wrote:
> From: Xuanqiang Luo <[email protected]>
> 
> If devm_platform_get_and_ioremap_resource() returns an error,
> mlxbf_i2c_init_resource() frees tmp_res before reading tmp_res->io to
> get the error code. This results in a use-after-free.
> 
> Save the error code before freeing tmp_res.
> 
> Fixes: b5b5b32081cd ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC")
> Cc: [email protected]
> Signed-off-by: Xuanqiang Luo <[email protected]>

merged to i2c/i2c-fixes.

Thanks,
Andi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.