From: Heiko Carstens <hca@linux.ibm.com>
To: Salah Triki <salah.triki@gmail.com>
Cc: Vineeth Vijayan <vneethv@linux.ibm.com>,
Peter Oberparleiter <oberpar@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] s390/cio: fix device lifecycle handling in css_alloc_subchannel()
Date: Wed, 4 Feb 2026 12:59:52 +0100 [thread overview]
Message-ID: <20260204115952.6906A12-hca@linux.ibm.com> (raw)
In-Reply-To: <20260130204800.217395-1-salah.triki@gmail.com>
On Fri, Jan 30, 2026 at 09:47:59PM +0100, Salah Triki wrote:
> `css_alloc_subchannel()` calls `device_initialize()` before setting up
> the DMA masks. If `dma_set_coherent_mask()` or `dma_set_mask()` fails,
> the error path frees the subchannel structure directly, bypassing
> the device model reference counting.
>
> Once `device_initialize()` has been called, the embedded struct device
> must be released via `put_device()`, allowing the release callback to
> free the container structure.
>
> Fix the error path by dropping the initial device reference with
> `put_device()` instead of calling `kfree()` directly.
>
> This ensures correct device lifetime handling and avoids potential
> use-after-free or double-free issues.
>
> Fixes: e5dcf0025d7af ("s390/css: move subchannel lock allocation")
>
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
> ---
> drivers/s390/cio/css.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
prev parent reply other threads:[~2026-02-04 12:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 20:47 [PATCH] s390/cio: fix device lifecycle handling in css_alloc_subchannel() Salah Triki
2026-02-04 11:47 ` Vineeth Vijayan
2026-02-04 11:59 ` Heiko Carstens [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260204115952.6906A12-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=oberpar@linux.ibm.com \
--cc=salah.triki@gmail.com \
--cc=svens@linux.ibm.com \
--cc=vneethv@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox