From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3117B145A1F for ; Sun, 1 Mar 2026 01:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329458; cv=none; b=Fc3iqhPDf5J4sGBnSc6f5jpmXqLytdpYGx4BgjBegRqEEfEFvIrM2lBa+VvYm2ZaY/zE0dykwTcQnSu5krDY6n1wZL6tnpPM0l8J9o9Jj9gZ4eWmih3HR3b8pGKUDWDEU/lqF8fkeQgzmzLqdp9uHq9BLIm5vomyByCrutvfYrU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329458; c=relaxed/simple; bh=otV3GEF3kHHJLDBVkRwo4eK4sT5qA0o7sYunVZWFT2g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OJviJJiOhA0VMYiBmZe7GEdb2FBlxrEyIP0nBiTGMHz7jT+GfJYZORjLN8Y0pGqKbob2OGyzWLMYuHB5uJ3aIsOgZC1J21aF+vcVdHyZYUpFaw+rPWO/GJHrgff1xsPJ5q9hE13ZP7EGgsycH1k/G2kShXBk7E6bn2uFDwVH1fs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WLZb+8D1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WLZb+8D1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FF2FC19421; Sun, 1 Mar 2026 01:44:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772329458; bh=otV3GEF3kHHJLDBVkRwo4eK4sT5qA0o7sYunVZWFT2g=; h=From:To:Cc:Subject:Date:From; b=WLZb+8D1C7RZ+2RHRqjenZdJ9GILccfoWew9FGRYxjpZZBPUKn3bsXz6sQABD4y07 H1jaYTEfXfCTesaeu6AYrMF/T3qgS4JPMH5Y6QyhFlfEXTGti1xLhOGFIpRNxTVoya 52zrgn4Hak2dhPht8EoWL9P1BA4gjtjxVlv2M6y0DR2gV8efmQ0WkoPwQv11AxrUy1 d9Bd9zeh+byIobFP61Z76qKBjT9iZpLGYO58edtBmArVLEEzTuUt0O9/AjJfPPVXxo Zs44lY+Y9BgGv0RJ8wyIe2OA1kISjUbMMzWhFO4mh1pU0hEJHxWmE0S1bt0NA+eBIi 9SCOEeBUoT0WQ== From: Sasha Levin To: stable@vger.kernel.org, lihaoxiang@isrc.iscas.ac.cn Cc: Dan Carpenter , Su Hui , "Christophe Leroy (CS GROUP)" , Ioana Ciornei , linuxppc-dev@lists.ozlabs.org Subject: FAILED: Patch "bus: fsl-mc: fix an error handling in fsl_mc_device_add()" failed to apply to 6.1-stable tree Date: Sat, 28 Feb 2026 20:44:15 -0500 Message-ID: <20260301014416.1706482-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 52f527d0916bcdd7621a0c9e7e599b133294d495 Mon Sep 17 00:00:00 2001 From: Haoxiang Li Date: Sat, 24 Jan 2026 18:20:54 +0800 Subject: [PATCH] bus: fsl-mc: fix an error handling in fsl_mc_device_add() In fsl_mc_device_add(), device_initialize() is called first. put_device() should be called to drop the reference if error occurs. And other resources would be released via put_device -> fsl_mc_device_release. So remove redundant kfree() in error handling path. Fixes: bbf9d17d9875 ("staging: fsl-mc: Freescale Management Complex (fsl-mc) bus driver") Cc: stable@vger.kernel.org Reported-by: Dan Carpenter Closes: https://lore.kernel.org/all/b767348e-d89c-416e-acea-1ebbff3bea20@stanley.mountain/ Signed-off-by: Su Hui Suggested-by: Christophe Leroy (CS GROUP) Signed-off-by: Haoxiang Li Reviewed-by: Ioana Ciornei Link: https://lore.kernel.org/r/20260124102054.1613093-1-lihaoxiang@isrc.iscas.ac.cn Signed-off-by: Christophe Leroy (CS GROUP) --- drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index 08b99b0b342f3..007223549887d 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -896,11 +896,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc, return 0; error_cleanup_dev: - kfree(mc_dev->regions); - if (mc_bus) - kfree(mc_bus); - else - kfree(mc_dev); + put_device(&mc_dev->dev); return error; } -- 2.51.0