Commit b62cef9a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'hwmon-for-v6.13-rc7' of...

Merge tag 'hwmon-for-v6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon fix from Guenter Roeck:
 "One patch to fix error handling in drivetemp driver"

* tag 'hwmon-for-v6.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (drivetemp) Fix driver producing garbage data when SCSI errors occur
parents 05c2d1f2 82163d63
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -165,6 +165,7 @@ static int drivetemp_scsi_command(struct drivetemp_data *st,
{
	u8 scsi_cmd[MAX_COMMAND_SIZE];
	enum req_op op;
	int err;

	memset(scsi_cmd, 0, sizeof(scsi_cmd));
	scsi_cmd[0] = ATA_16;
@@ -192,8 +193,11 @@ static int drivetemp_scsi_command(struct drivetemp_data *st,
	scsi_cmd[12] = lba_high;
	scsi_cmd[14] = ata_command;

	return scsi_execute_cmd(st->sdev, scsi_cmd, op, st->smartdata,
	err = scsi_execute_cmd(st->sdev, scsi_cmd, op, st->smartdata,
			       ATA_SECT_SIZE, HZ, 5, NULL);
	if (err > 0)
		err = -EIO;
	return err;
}

static int drivetemp_ata_command(struct drivetemp_data *st, u8 feature,