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 7A39136A35E; Thu, 16 Jul 2026 13:41: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=1784209280; cv=none; b=b7yFvX3jMAEud6E0ovgSKTrJit5v6gG8LeZlJSM1xZH5uujQvQX6mcb7tpS2CqhCxdhUXu3Du1sYY4kBfXcm6knnuM+UhuZvyXVNbLhPEUL5jYlaLLdb+ldAcDTZ7398/8ITozX2VNbNhY32NpGfxSkyEUYFJsc/RQHUjs59DPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784209280; c=relaxed/simple; bh=Sly6tAyOcbyYJpiKm77FWocTo2UgqoMH0UOlB4GUEdI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NVb83blsR0jmVUooTJWlczDHJOGMGV4r1Q9lzRF0vlvKn/1b6k6U4SzmMsSz6aaa2P8vUenls3AqPK23u/2qGMe00KHDIgL+ubSWGqpGVyIhY7+Maw+joqlrLgr57Ycb30aPG6xZqZiiLx8jIZWTz0MXlAgYukfCrO/ktGFhWCo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=oZ6aMEVo; 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="oZ6aMEVo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE5A21F000E9; Thu, 16 Jul 2026 13:41:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784209279; bh=qcHt0LeoZxPeJo/i8KrvWmICIpozYPpTUgvzh6a+KbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=oZ6aMEVokbuyjhvhtLnGFNevz2BwbuLOrJ4cDq3Yyiw8CmOkXlZzl9+FnfjejwbHk nHmE0vlXTIHmor1Lrupq+N6DfZIPpl9dkpo0Op7hQQiIGu62LmoI6TrF0UDSSjDnhw 9jOfNRcXafwQDU1aeC1EjR2ompbfS9yOioQhkzFo= 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 7.1 072/518] iio: pressure: mpl115: fix runtime PM leak on read error Date: Thu, 16 Jul 2026 15:25:40 +0200 Message-ID: <20260716133049.363135450@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260716133047.772246337@linuxfoundation.org> References: <20260716133047.772246337@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 7.1-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;