Commit 0e6582a5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "Small fixes, two in drivers and the remaining a sign conversion probem
  in sd with no user visible consequences (non-zero is error)"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: target: tcm_loop: Fix NULL ptr dereference
  scsi: isci: Fix use-after-free in device removal path
  scsi: sd: Fix return code handling in sd_spinup_disk()
parents 59825bc9 b71cb088
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1252,6 +1252,9 @@ void isci_host_deinit(struct isci_host *ihost)

	wait_for_stop(ihost);

	/* No further IRQ-driven scheduling can happen past wait_for_stop(). */
	tasklet_kill(&ihost->completion_tasklet);

	/* phy stop is after controller stop to allow port and device to
	 * go idle before shutting down the phys, but the expectation is
	 * that i/o has been shut off well before we reach this
+1 −2
Original line number Diff line number Diff line
@@ -2476,8 +2476,7 @@ sd_spinup_disk(struct scsi_disk *sdkp)
{
	static const u8 cmd[10] = { TEST_UNIT_READY };
	unsigned long spintime_expire = 0;
	int spintime, sense_valid = 0;
	unsigned int the_result;
	int the_result, spintime, sense_valid = 0;
	struct scsi_sense_hdr sshdr;
	struct scsi_failure failure_defs[] = {
		/* Do not retry Medium Not Present */
+10 −2
Original line number Diff line number Diff line
@@ -393,6 +393,7 @@ static int tcm_loop_driver_probe(struct device *dev)
	if (error) {
		pr_err("%s: scsi_add_host failed\n", __func__);
		scsi_host_put(sh);
		tl_hba->sh = NULL;
		return -ENODEV;
	}
	return 0;
@@ -406,9 +407,11 @@ static void tcm_loop_driver_remove(struct device *dev)
	tl_hba = to_tcm_loop_hba(dev);
	sh = tl_hba->sh;

	if (sh) {
		scsi_remove_host(sh);
		scsi_host_put(sh);
	}
}

static void tcm_loop_release_adapter(struct device *dev)
{
@@ -436,6 +439,11 @@ static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host
		return -ENODEV;
	}

	if (!tl_hba->sh) {
		device_unregister(&tl_hba->dev);
		return -ENODEV;
	}

	return 0;
}