Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C221E44CADF; Tue, 21 Jul 2026 20:04:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664282; cv=none; b=jWocECgxkfX2e8pWNpcckxyuMK75WY2W0EA8Gc3PV938L7eo0Rfq5Rp8VWo0XJPiqd2vtd56dY/MGotAu3at8qfzfwayLStn/EjFolCOog8OutF6dgZBMiTGN0MiNkdcjW1aGIlXIaRr7avzvtRYMUB2N73s1v99jn+sJmy6Bd0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784664282; c=relaxed/simple; bh=e8J3co9npk01EVquHJgE0646k4Ro1uDhmkkoB9gtoZs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L/7mtqqhBm95Ya2OXfifpSWVEVHw71hQ/q1gnGnkaFQ2YIPOFlk82Or4qlEwmZszQ4qVWjqVlXTP1+bfZDp9FPW2RuFmV6bAIsxQeeulBma0tQF6D++L1nIgO04XxgrG5bnY30Xe1D8vaUREoCACBY3dNjkE79wgA47eZh3PUDI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Qlfk6lME; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Qlfk6lME" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D321A1F000E9; Tue, 21 Jul 2026 20:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784664281; bh=LhgMozNFs6bdwng9HXFK8U0ans2w0xlLnjrBakdzdGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Qlfk6lMEIpLbyLAP4f0Ob4Rdg9yIzgfZrPQNSn1ImOsI9m9NY7/izKc6P7XYw9iKe Cp6el1866o8lAxBm57XUvYOSeyTuA0dUiNyZVrbjSAJtMpwEjGAhjGPb3llKkQxgZ2 ikZxR15V86blDdb+kFINo9L+JLQIbBDckLzxdf5A= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Biren Pandya , Stable@vger.kernel.org, Jonathan Cameron , Sasha Levin Subject: [PATCH 6.12 1140/1276] iio: pressure: mpl115: fix runtime PM leak on read error Date: Tue, 21 Jul 2026 17:26:23 +0200 Message-ID: <20260721152511.514797001@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152446.065700225@linuxfoundation.org> References: <20260721152446.065700225@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Biren Pandya [ Upstream commit fbe67ff37a6fd855a6c097f84f3738bd13d0a898 ] mpl115_read_raw() takes a runtime PM reference with pm_runtime_get_sync() before reading the processed pressure or raw temperature, but on the read error path it returns without calling pm_runtime_put_autosuspend(). Each failed read therefore leaks a runtime PM reference and prevents the device from autosuspending. Drop the reference before checking the return value so both the success and error paths are balanced. Fixes: 0c3a333524a3 ("iio: pressure: mpl115: Implementing low power mode by shutdown gpio") Signed-off-by: Biren Pandya Assisted-by: Claude:claude-opus-4-8 coccinelle Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/iio/pressure/mpl115.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/iio/pressure/mpl115.c +++ b/drivers/iio/pressure/mpl115.c @@ -106,18 +106,18 @@ static int mpl115_read_raw(struct iio_de case IIO_CHAN_INFO_PROCESSED: pm_runtime_get_sync(data->dev); ret = mpl115_comp_pressure(data, val, val2); + pm_runtime_put_autosuspend(data->dev); if (ret < 0) return ret; - pm_runtime_put_autosuspend(data->dev); return IIO_VAL_INT_PLUS_MICRO; case IIO_CHAN_INFO_RAW: pm_runtime_get_sync(data->dev); /* temperature -5.35 C / LSB, 472 LSB is 25 C */ ret = mpl115_read_temp(data); + pm_runtime_put_autosuspend(data->dev); if (ret < 0) return ret; - pm_runtime_put_autosuspend(data->dev); *val = ret >> 6; return IIO_VAL_INT;