From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A0C543B5303; Mon, 23 Mar 2026 13:58:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774274332; cv=none; b=qLCksZbjHfHWkNHh8LqRvqOWYIPUEpEG/HFr8kGeqjRZzwulHtPJJZuBX6b5EwGJzy4zKddpACnp37Z/kUxYlaccnWVFljSFagfDzczNmQX/80/hwa6TAoNEw79vXIxFT26POTWDrFYpOqNoCpP8h/QghAHO/30OfQSupdD9J9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774274332; c=relaxed/simple; bh=UHyJzWMCazCspACIyd94ctY0p52OjbJ9ZUrSk8AkQA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NO3s7gZ/efI/LoYPrheHEm7dm0i34fRweMnuB7i03MZGs6Dyb0IsmMrF5vZVogN2OMwDDTa7om6AEt1mPIzE6W7BQca/sipW4JQU2I+KmU7GDfi0xs1QnSgU4sMa6rPnWJmF75q9SMUQfVD3Wrf5eW9Yc7dO3J+x6mCHZ/bNE1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=aDGoflIN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="aDGoflIN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2636CC2BC9E; Mon, 23 Mar 2026 13:58:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774274332; bh=UHyJzWMCazCspACIyd94ctY0p52OjbJ9ZUrSk8AkQA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aDGoflINJQ6PQplGcE4+H2uh3MxErt3f4B3SMIy3B/V1UO5onlAEEyOeeyU9Fd86W /1Oi2ttMlY/yf/Sv9VrDQyTVVbYkuCGjTYPsf7NI+twvFHS6dWkVbOgZw/xxCb94i0 Ps/Ukba90+Q/HsYm2bqhKFdYQE242+JM0wqq7YNI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sanman Pradhan , Guenter Roeck Subject: [PATCH 6.19 185/220] hwmon: (pmbus/isl68137) Fix unchecked return value and use sysfs_emit() Date: Mon, 23 Mar 2026 14:46:02 +0100 Message-ID: <20260323134510.423072294@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134504.575022936@linuxfoundation.org> References: <20260323134504.575022936@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sanman Pradhan commit 86259558e422b250aa6aa57163a6d759074573f5 upstream. isl68137_avs_enable_show_page() uses the return value of pmbus_read_byte_data() without checking for errors. If the I2C transaction fails, a negative error code is passed through bitwise operations, producing incorrect output. Add an error check to propagate the return value if it is negative. Additionally, modernize the callback by replacing sprintf() with sysfs_emit(). Fixes: 038a9c3d1e424 ("hwmon: (pmbus/isl68137) Add driver for Intersil ISL68137 PWM Controller") Cc: stable@vger.kernel.org Signed-off-by: Sanman Pradhan Link: https://lore.kernel.org/r/20260318193952.47908-2-sanman.pradhan@hpe.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/pmbus/isl68137.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/drivers/hwmon/pmbus/isl68137.c +++ b/drivers/hwmon/pmbus/isl68137.c @@ -98,8 +98,11 @@ static ssize_t isl68137_avs_enable_show_ { int val = pmbus_read_byte_data(client, page, PMBUS_OPERATION); - return sprintf(buf, "%d\n", - (val & ISL68137_VOUT_AVS) == ISL68137_VOUT_AVS ? 1 : 0); + if (val < 0) + return val; + + return sysfs_emit(buf, "%d\n", + (val & ISL68137_VOUT_AVS) == ISL68137_VOUT_AVS); } static ssize_t isl68137_avs_enable_store_page(struct i2c_client *client,