Commit 0f386a60 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "Ten fixes, seven of which are in drivers.

  The core fixes are one to fix a potential crash on resume, one to sort
  out our reference count releases to avoid releasing in-use modules and
  one to adjust the cmd per lun calculation to avoid an overflow in
  hyper-v"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: ufs: ufs-pci: Force a full restore after suspend-to-disk
  scsi: qla2xxx: Fix unmap of already freed sgl
  scsi: qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()
  scsi: qla2xxx: Return -ENOMEM if kzalloc() fails
  scsi: sd: Fix crashes in sd_resume_runtime()
  scsi: mpi3mr: Fix duplicate device entries when scanning through sysfs
  scsi: core: Put LLD module refcnt after SCSI device is released
  scsi: storvsc: Fix validation for unsolicited incoming packets
  scsi: iscsi: Fix set_param() handling
  scsi: core: Fix shost->cmd_per_lun calculation in scsi_add_host_with_dma()
parents 9c0c4d24 4e5483b8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -220,7 +220,8 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
		goto fail;
	}

	shost->cmd_per_lun = min_t(short, shost->cmd_per_lun,
	/* Use min_t(int, ...) in case shost->can_queue exceeds SHRT_MAX */
	shost->cmd_per_lun = min_t(int, shost->cmd_per_lun,
				   shost->can_queue);

	error = scsi_init_sense_cache(shost);
+1 −1
Original line number Diff line number Diff line
@@ -3736,7 +3736,7 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
	shost->max_lun = -1;
	shost->unique_id = mrioc->id;

	shost->max_channel = 1;
	shost->max_channel = 0;
	shost->max_id = 0xFFFFFFFF;

	if (prot_mask >= 0)
+1 −1
Original line number Diff line number Diff line
@@ -431,7 +431,7 @@ qla2x00_process_els(struct bsg_job *bsg_job)
	goto done_free_fcport;

done_free_fcport:
	if (bsg_request->msgcode == FC_BSG_RPT_ELS)
	if (bsg_request->msgcode != FC_BSG_RPT_ELS)
		qla2x00_free_fcport(fcport);
done:
	return rval;
+1 −1
Original line number Diff line number Diff line
@@ -4157,7 +4157,7 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len,
					ql_dbg_pci(ql_dbg_init, ha->pdev,
					    0xe0ee, "%s: failed alloc dsd\n",
					    __func__);
					return 1;
					return -ENOMEM;
				}
				ha->dif_bundle_kallocs++;

+5 −9
Original line number Diff line number Diff line
@@ -3319,8 +3319,7 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type,
			"RESET-RSP online/active/old-count/new-count = %d/%d/%d/%d.\n",
			vha->flags.online, qla2x00_reset_active(vha),
			cmd->reset_count, qpair->chip_reset);
		spin_unlock_irqrestore(qpair->qp_lock_ptr, flags);
		return 0;
		goto out_unmap_unlock;
	}

	/* Does F/W have an IOCBs for this request */
@@ -3445,10 +3444,6 @@ int qlt_rdy_to_xfer(struct qla_tgt_cmd *cmd)
	prm.sg = NULL;
	prm.req_cnt = 1;

	/* Calculate number of entries and segments required */
	if (qlt_pci_map_calc_cnt(&prm) != 0)
		return -EAGAIN;

	if (!qpair->fw_started || (cmd->reset_count != qpair->chip_reset) ||
	    (cmd->sess && cmd->sess->deleted)) {
		/*
@@ -3466,6 +3461,10 @@ int qlt_rdy_to_xfer(struct qla_tgt_cmd *cmd)
		return 0;
	}

	/* Calculate number of entries and segments required */
	if (qlt_pci_map_calc_cnt(&prm) != 0)
		return -EAGAIN;

	spin_lock_irqsave(qpair->qp_lock_ptr, flags);
	/* Does F/W have an IOCBs for this request */
	res = qlt_check_reserve_free_req(qpair, prm.req_cnt);
@@ -3870,9 +3869,6 @@ void qlt_free_cmd(struct qla_tgt_cmd *cmd)

	BUG_ON(cmd->cmd_in_wq);

	if (cmd->sg_mapped)
		qlt_unmap_sg(cmd->vha, cmd);

	if (!cmd->q_full)
		qlt_decr_num_pend_cmds(cmd->vha);

Loading