Commit 3cde55ee authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "Five minor bug fixes.

  The libfc one is a tiny memory leak, the zfcp one is an incorrect user
  visible parameter and the rest are on error legs or obscure features"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: 53c700: pass correct "dev" to dma_alloc_attrs()
  scsi: bnx2fc: Fix error handling in probe()
  scsi: scsi_debug: fix write_same with virtual_gb problem
  scsi: libfc: free skb when receiving invalid flogi resp
  scsi: zfcp: fix sysfs block queue limit output for max_segment_size
parents b9de6efe 8437fcf1
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -403,7 +403,6 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device)
		goto failed;
		goto failed;


	/* report size limit per scatter-gather segment */
	/* report size limit per scatter-gather segment */
	adapter->dma_parms.max_segment_size = ZFCP_QDIO_SBALE_LEN;
	adapter->ccw_device->dev.dma_parms = &adapter->dma_parms;
	adapter->ccw_device->dev.dma_parms = &adapter->dma_parms;


	adapter->stat_read_buf_num = FSF_STATUS_READS_RECOM;
	adapter->stat_read_buf_num = FSF_STATUS_READS_RECOM;
+2 −0
Original line number Original line Diff line number Diff line
@@ -428,6 +428,8 @@ static struct scsi_host_template zfcp_scsi_host_template = {
	.max_sectors		 = (((QDIO_MAX_ELEMENTS_PER_BUFFER - 1)
	.max_sectors		 = (((QDIO_MAX_ELEMENTS_PER_BUFFER - 1)
				     * ZFCP_QDIO_MAX_SBALS_PER_REQ) - 2) * 8,
				     * ZFCP_QDIO_MAX_SBALS_PER_REQ) - 2) * 8,
				   /* GCD, adjusted later */
				   /* GCD, adjusted later */
	/* report size limit per scatter-gather segment */
	.max_segment_size	 = ZFCP_QDIO_SBALE_LEN,
	.dma_boundary		 = ZFCP_QDIO_SBALE_LEN - 1,
	.dma_boundary		 = ZFCP_QDIO_SBALE_LEN - 1,
	.shost_attrs		 = zfcp_sysfs_shost_attrs,
	.shost_attrs		 = zfcp_sysfs_shost_attrs,
	.sdev_attrs		 = zfcp_sysfs_sdev_attrs,
	.sdev_attrs		 = zfcp_sysfs_sdev_attrs,
+1 −1
Original line number Original line Diff line number Diff line
@@ -295,7 +295,7 @@ NCR_700_detect(struct scsi_host_template *tpnt,
	if(tpnt->sdev_attrs == NULL)
	if(tpnt->sdev_attrs == NULL)
		tpnt->sdev_attrs = NCR_700_dev_attrs;
		tpnt->sdev_attrs = NCR_700_dev_attrs;


	memory = dma_alloc_attrs(hostdata->dev, TOTAL_MEM_SIZE, &pScript,
	memory = dma_alloc_attrs(dev, TOTAL_MEM_SIZE, &pScript,
				 GFP_KERNEL, DMA_ATTR_NON_CONSISTENT);
				 GFP_KERNEL, DMA_ATTR_NON_CONSISTENT);
	if(memory == NULL) {
	if(memory == NULL) {
		printk(KERN_ERR "53c700: Failed to allocate memory for driver, detaching\n");
		printk(KERN_ERR "53c700: Failed to allocate memory for driver, detaching\n");
+2 −2
Original line number Original line Diff line number Diff line
@@ -240,6 +240,7 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba)
		return NULL;
		return NULL;
	}
	}


	cmgr->hba = hba;
	cmgr->free_list = kcalloc(arr_sz, sizeof(*cmgr->free_list),
	cmgr->free_list = kcalloc(arr_sz, sizeof(*cmgr->free_list),
				  GFP_KERNEL);
				  GFP_KERNEL);
	if (!cmgr->free_list) {
	if (!cmgr->free_list) {
@@ -256,7 +257,6 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba)
		goto mem_err;
		goto mem_err;
	}
	}


	cmgr->hba = hba;
	cmgr->cmds = (struct bnx2fc_cmd **)(cmgr + 1);
	cmgr->cmds = (struct bnx2fc_cmd **)(cmgr + 1);


	for (i = 0; i < arr_sz; i++)  {
	for (i = 0; i < arr_sz; i++)  {
@@ -295,7 +295,7 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba)


	/* Allocate pool of io_bdts - one for each bnx2fc_cmd */
	/* Allocate pool of io_bdts - one for each bnx2fc_cmd */
	mem_size = num_ios * sizeof(struct io_bdt *);
	mem_size = num_ios * sizeof(struct io_bdt *);
	cmgr->io_bdt_pool = kmalloc(mem_size, GFP_KERNEL);
	cmgr->io_bdt_pool = kzalloc(mem_size, GFP_KERNEL);
	if (!cmgr->io_bdt_pool) {
	if (!cmgr->io_bdt_pool) {
		printk(KERN_ERR PFX "failed to alloc io_bdt_pool\n");
		printk(KERN_ERR PFX "failed to alloc io_bdt_pool\n");
		goto mem_err;
		goto mem_err;
+3 −3
Original line number Original line Diff line number Diff line
@@ -1726,14 +1726,14 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
	    fc_frame_payload_op(fp) != ELS_LS_ACC) {
	    fc_frame_payload_op(fp) != ELS_LS_ACC) {
		FC_LPORT_DBG(lport, "FLOGI not accepted or bad response\n");
		FC_LPORT_DBG(lport, "FLOGI not accepted or bad response\n");
		fc_lport_error(lport, fp);
		fc_lport_error(lport, fp);
		goto err;
		goto out;
	}
	}


	flp = fc_frame_payload_get(fp, sizeof(*flp));
	flp = fc_frame_payload_get(fp, sizeof(*flp));
	if (!flp) {
	if (!flp) {
		FC_LPORT_DBG(lport, "FLOGI bad response\n");
		FC_LPORT_DBG(lport, "FLOGI bad response\n");
		fc_lport_error(lport, fp);
		fc_lport_error(lport, fp);
		goto err;
		goto out;
	}
	}


	mfs = ntohs(flp->fl_csp.sp_bb_data) &
	mfs = ntohs(flp->fl_csp.sp_bb_data) &
@@ -1743,7 +1743,7 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp,
		FC_LPORT_DBG(lport, "FLOGI bad mfs:%hu response, "
		FC_LPORT_DBG(lport, "FLOGI bad mfs:%hu response, "
			     "lport->mfs:%hu\n", mfs, lport->mfs);
			     "lport->mfs:%hu\n", mfs, lport->mfs);
		fc_lport_error(lport, fp);
		fc_lport_error(lport, fp);
		goto err;
		goto out;
	}
	}


	if (mfs <= lport->mfs) {
	if (mfs <= lport->mfs) {
Loading