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 31520625 for ; Fri, 15 May 2026 08:32:10 +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=1778833930; cv=none; b=G8QVWqj0e1wKxx4+3fu/Qlescu9Q5q0k4URwcLRMO0rmpEhLPXpo1beKjhNG0KTMZBRTJXOhwcadCuYE8Ea1cXI5cvGHcwRrdRnafihXTNrRNf+Ug7p1n2VPmgixC6raZIR+NK8Ix6063/2+cfCCnNtgvwwU/8ujz9e8c+4CC9s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778833930; c=relaxed/simple; bh=tQMjRkuTZrV8qls0V/DSlgF/n78sdaeJUQeqEc1Qo40=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=bAwkUgyS89FH5aJqv3gf9RaZPrzyUE1Txun2jQ/CqhXdEY39VUwQGBndiXb/H1v6C9j7IzjbuOY4U8HTwSUDJzBG2F2U7tzAmn6Mw+BNJiO4FuwMpCC41V5/0VmLj2ofBRN/UNrPUUTWeg14m5pfGHQGhVtzV/7/7NDmyXIqsGo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=C206qhTv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C206qhTv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA591C2BCF7; Fri, 15 May 2026 08:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778833930; bh=tQMjRkuTZrV8qls0V/DSlgF/n78sdaeJUQeqEc1Qo40=; h=Subject:To:Cc:From:Date:From; b=C206qhTvxZjHTPplk21biAu+v8Wp4ophEtCsnyTyxqLqmVMd5dGIondLIZf/t+jsd xOwaCdZ2fERzNEDGp5TnDWqJ4LTsProD9lez8NM620nKm4yTllW9LRIUhwC9Byll0B 27OoL0FclsAcPTLxbeFQzh3mO/rYHK12UALIs2xo= Subject: FAILED: patch "[PATCH] spi: mpc52xx: fix use-after-free on registration failure" failed to apply to 5.15-stable tree To: johan@kernel.org,broonie@kernel.org,grant.likely@secretlab.ca Cc: From: Date: Fri, 15 May 2026 10:32:03 +0200 Message-ID: <2026051503-paying-unrated-0889@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-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 . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x f62c060272b9d7423b1650b844e8e4e7b8f9f925 # git commit -s git send-email --to '' --in-reply-to '2026051503-paying-unrated-0889@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From f62c060272b9d7423b1650b844e8e4e7b8f9f925 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 21 Apr 2026 14:58:00 +0200 Subject: [PATCH] spi: mpc52xx: fix use-after-free on registration failure Make sure to disable and free the interrupts in case controller registration fails to avoid a potential use-after-free and resource leak. This issue was flagged by Sashiko when reviewing a controller deregistration fix. Fixes: 42bbb70980f3 ("powerpc/5200: Add mpc5200-spi (non-PSC) device driver") Cc: stable@vger.kernel.org # 2.6.33 Cc: Grant Likely Link: https://sashiko.dev/#/patchset/20260414134319.978196-1-johan%40kernel.org?part=3 Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260421125800.1537361-1-johan@kernel.org Signed-off-by: Mark Brown diff --git a/drivers/spi/spi-mpc52xx.c b/drivers/spi/spi-mpc52xx.c index c8c8e6bdf421..924d820448fb 100644 --- a/drivers/spi/spi-mpc52xx.c +++ b/drivers/spi/spi-mpc52xx.c @@ -498,6 +498,9 @@ static int mpc52xx_spi_probe(struct platform_device *op) err_register: dev_err(&ms->host->dev, "initialization failed\n"); + free_irq(ms->irq0, ms); + free_irq(ms->irq1, ms); + cancel_work_sync(&ms->work); err_gpio: while (i-- > 0) gpiod_put(ms->gpio_cs[i]);