summaryrefslogtreecommitdiff
path: root/scripts/generate_rust_analyzer.py
diff options
context:
space:
mode:
authorDaniil Stas <daniil.stas@posteo.net>2025-01-06 00:36:18 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-17 15:40:59 +0300
commit42268d885e44af875a6474f7bba519cc6cea6a9d (patch)
treef9ac790c9a1a30ac7d729759b068aa4dd4316ee1 /scripts/generate_rust_analyzer.py
parent0587f10fd29456d2d829a425d51f566cf6914ef7 (diff)
downloadlinux-42268d885e44af875a6474f7bba519cc6cea6a9d.tar.xz
hwmon: (drivetemp) Fix driver producing garbage data when SCSI errors occur
[ Upstream commit 82163d63ae7a4c36142cd252388737205bb7e4b9 ] scsi_execute_cmd() function can return both negative (linux codes) and positive (scsi_cmnd result field) error codes. Currently the driver just passes error codes of scsi_execute_cmd() to hwmon core, which is incorrect because hwmon only checks for negative error codes. This leads to hwmon reporting uninitialized data to userspace in case of SCSI errors (for example if the disk drive was disconnected). This patch checks scsi_execute_cmd() output and returns -EIO if it's error code is positive. Fixes: 5b46903d8bf37 ("hwmon: Driver for disk and solid state drives with temperature sensors") Signed-off-by: Daniil Stas <daniil.stas@posteo.net> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Chris Healy <cphealy@gmail.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: Bart Van Assche <bvanassche@acm.org> Cc: linux-kernel@vger.kernel.org Cc: linux-scsi@vger.kernel.org Cc: linux-ide@vger.kernel.org Cc: linux-hwmon@vger.kernel.org Link: https://lore.kernel.org/r/20250105213618.531691-1-daniil.stas@posteo.net [groeck: Avoid inline variable declaration for portability] Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions