From mboxrd@z Thu Jan 1 00:00:00 1970 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 E1E9C2F2619; Thu, 16 Jul 2026 14:02:19 +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=1784210540; cv=none; b=plTwvLbfBAmyS+ILN84VgkPFIv9DtpwhZBdELnkTQrJCRACIWAC0fmAVdWbxGtyXHl1YPJ12q0KNvPpv7k9pMHfbUB7hFVmv/fOVFgBA6SdfApylcfHm7ovFcXF/LqEJXRvN05UvHLYVoIZoyOZVFXE4/Ia4im3gQqXZx7tiRFY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784210540; c=relaxed/simple; bh=f2EO4JGoARsqRi43imZz2LTbBmIe54pUDSjjW6CxKig=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B1aGU7V8hk5MonfxymeA7cXUNNsODQc+x7UgWwKhgwlwN8Q9h/MNVMxHZ4Yhg2PLKf4MTRt3oljTfF3MEwHXmf32T/PBCKS9BNOgZ/frHfE9HMwCom3+VURYinq1oB97kLoxtjRSaVdA65x1l+PgFYPVm6pRROU2V+eb8s9EUQs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OgmxuIUv; 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="OgmxuIUv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 528651F000E9; Thu, 16 Jul 2026 14:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784210539; bh=8G+B3HCgLt5BLDtAhqPGuwAhjljnD0Perkqe6dwiYUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OgmxuIUv7SShK6pCwQ3kufSniSM4V2lRohnO3yDVs/d4wtjCtVBzn/I79PAl77wM+ 2vNvgqX8AepuSDm692NlLeEoHstsk0DeIPSe1q1c4ojUs92L9p+lmalgrjryhd1OWI RggfcGgFSMdofCnfXn2d7ioHRIoefm2TFVaThMoo= 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 Subject: [PATCH 6.18 084/480] iio: pressure: mpl115: fix runtime PM leak on read error Date: Thu, 16 Jul 2026 15:27:11 +0200 Message-ID: <20260716133046.528505167@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260716133044.672218725@linuxfoundation.org> References: <20260716133044.672218725@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Biren Pandya commit fbe67ff37a6fd855a6c097f84f3738bd13d0a898 upstream. 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: 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;