From: Johan Hovold <johan@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Saravana Kannan <saravanak@kernel.org>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH 0/2] spi: fix resource leaks on device setup failure
Date: Fri, 10 Apr 2026 17:49:05 +0200 [thread overview]
Message-ID: <20260410154907.129248-1-johan@kernel.org> (raw)
Make sure to call controller cleanup() if spi_setup() fails while
registering a device to avoid leaking any resources allocated by
setup().
Johan
Changes in v2:
- only call cleanup() if spi_setup() fails during registration
- use spi_cleanup() helper
- fix controller cleanup() documentation (new patch)
Johan Hovold (2):
spi: fix resource leaks on device setup failure
spi: fix controller cleanup() documentation
drivers/spi/spi.c | 61 +++++++++++++++++++++++++----------------
include/linux/spi/spi.h | 2 +-
2 files changed, 38 insertions(+), 25 deletions(-)
--
2.52.0
next reply other threads:[~2026-04-10 15:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 15:49 Johan Hovold [this message]
2026-04-10 15:49 ` [PATCH 1/2] spi: fix resource leaks on device setup failure Johan Hovold
2026-04-10 15:49 ` [PATCH 2/2] spi: fix controller cleanup() documentation Johan Hovold
2026-04-10 15:51 ` [PATCH 0/2] spi: fix resource leaks on device setup failure Johan Hovold
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=20260410154907.129248-1-johan@kernel.org \
--to=johan@kernel.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=saravanak@kernel.org \
/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