From: Jonathan Cameron <jic23@kernel.org>
To: Matti Vaittinen <matti.vaittinen@linux.dev>
Cc: "Matti Vaittinen" <mazziesaccount@gmail.com>,
"Matti Vaittinen" <matti.vaittinen@fi.rohmeurope.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Mehdi Djait" <mehdi.djait.k@gmail.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/3] iio: accel: kionix-kx022a: Prevent memory leak and fix state
Date: Sun, 6 Sep 2026 22:36:32 +0100 [thread overview]
Message-ID: <20260906223632.04168b67@jic23-huawei> (raw)
In-Reply-To: <d01b5c2d1aa3dc06dac7cb69e44b4caeda0936aa.1788336588.git.mazziesaccount@gmail.com>
On Wed, 2 Sep 2026 11:49:05 +0300
Matti Vaittinen <matti.vaittinen@linux.dev> wrote:
> From: Matti Vaittinen <mazziesaccount@gmail.com>
>
> The driver allocates memory for samples at buffer enable path. If regmap
> operation fails in the kx022a_fifo_enable() at the buffer enable path, the
> allocated memory is never freed. Furthermore, the state information and
> previous hardware configuration(s) aren't undone, potentially leaving
> WMI interrupts and buffers enabled, or driver state flags wrong.
>
> Free the memory and revert the hardware configuration and state flags on
> error path.
>
> Fixes: e7123a4dfcd7 ("iio: accel: kionix-kx022a: Refactor driver and add chip_info structure")
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
> Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Applied and marked for stable.
next prev parent reply other threads:[~2026-09-06 21:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 8:48 [PATCH v3 0/3] ROHM IIO fixes Matti Vaittinen
2026-09-02 8:48 ` [PATCH v3 1/3] iio: light: rohm-bu27034: Fix infinite delay on error Matti Vaittinen
2026-09-06 21:34 ` Jonathan Cameron
2026-09-02 8:49 ` [PATCH v3 2/3] iio: accel: kionix-kx022a: Prevent memory leak and fix state Matti Vaittinen
2026-09-06 21:36 ` Jonathan Cameron [this message]
2026-09-02 8:49 ` [PATCH v3 3/3] iio: accel: kionix-kx022a: Fix IPOL macro name Matti Vaittinen
2026-09-06 21:38 ` Jonathan Cameron
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=20260906223632.04168b67@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matti.vaittinen@fi.rohmeurope.com \
--cc=matti.vaittinen@linux.dev \
--cc=mazziesaccount@gmail.com \
--cc=mehdi.djait.k@gmail.com \
--cc=nuno.sa@analog.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