This is a note to let you know that I've just added the patch titled iio: tmag5273: Fix runtime PM leak on measurement error to the 6.3-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: iio-tmag5273-fix-runtime-pm-leak-on-measurement-error.patch and it can be found in the queue-6.3 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 265c82ea8b172129cb6d4eff41af856c3aff6168 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen <lars@xxxxxxxxxx> Date: Thu, 13 Apr 2023 18:37:52 -0700 Subject: iio: tmag5273: Fix runtime PM leak on measurement error From: Lars-Peter Clausen <lars@xxxxxxxxxx> commit 265c82ea8b172129cb6d4eff41af856c3aff6168 upstream. The tmag5273 gets a runtime PM reference before reading a measurement and releases it when done. But if the measurement fails the tmag5273_read_raw() function exits before releasing the reference. Make sure that this error path also releases the runtime PM reference. Fixes: 866a1389174b ("iio: magnetometer: add ti tmag5273 driver") Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx> Acked-by: Gerald Loacker <gerald.loacker@xxxxxxxxxxxxxx> Reviewed-by: Nuno Sa <nuno.sa@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230414013752.498767-1-lars@xxxxxxxxxx Cc: <Stable@xxxxxxxxxxxxxxx> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/iio/magnetometer/tmag5273.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/iio/magnetometer/tmag5273.c +++ b/drivers/iio/magnetometer/tmag5273.c @@ -296,12 +296,13 @@ static int tmag5273_read_raw(struct iio_ return ret; ret = tmag5273_get_measure(data, &t, &x, &y, &z, &angle, &magnitude); - if (ret) - return ret; pm_runtime_mark_last_busy(data->dev); pm_runtime_put_autosuspend(data->dev); + if (ret) + return ret; + switch (chan->address) { case TEMPERATURE: *val = t; Patches currently in stable-queue which might be from lars@xxxxxxxxxx are queue-6.3/iio-tmag5273-fix-runtime-pm-leak-on-measurement-error.patch queue-6.3/iio-ad4130-make-sure-clock-provider-gets-removed.patch