Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"This is a set of user visible fixes (excepting one format string
change).

Four of the qla2xxx fixes only affect the firmware dump path, but it's
still important to the enterprise. The rest are various NULL pointer
crash conditions or outright driver hangs"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: cxgb4i: libcxgbi: in error case RST tcp conn
scsi: scsi_debug: Avoid PI being disabled when TPGS is enabled
scsi: qla2xxx: Fix extraneous ref on sp's after adapter break
scsi: lpfc: prevent potential null pointer dereference
scsi: lpfc: Avoid NULL pointer dereference in lpfc_els_abort()
scsi: lpfc: nvmet_fc: fix format string
scsi: qla2xxx: Fix crash due to NULL pointer dereference of ctx
scsi: qla2xxx: Fix mailbox pointer error in fwdump capture
scsi: qla2xxx: Set bit 15 for DIAG_ECHO_TEST MBC
scsi: qla2xxx: Modify T262 FW dump template to specify same start/end to debug customer issues
scsi: qla2xxx: Fix crash due to mismatch mumber of Q-pair creation for Multi queue
scsi: qla2xxx: Fix NULL pointer access due to redundant fc_host_port_name call
scsi: qla2xxx: Fix recursive loop during target mode configuration for ISP25XX leaving system unresponsive
scsi: bnx2fc: fix race condition in bnx2fc_get_host_stats()
scsi: qla2xxx: don't disable a not previously enabled PCI device

+102 -78
+1
drivers/scsi/bnx2fc/bnx2fc.h
··· 191 191 struct bnx2fc_cmd_mgr *cmd_mgr; 192 192 spinlock_t hba_lock; 193 193 struct mutex hba_mutex; 194 + struct mutex hba_stats_mutex; 194 195 unsigned long adapter_state; 195 196 #define ADAPTER_STATE_UP 0 196 197 #define ADAPTER_STATE_GOING_DOWN 1
+8 -2
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
··· 663 663 if (!fw_stats) 664 664 return NULL; 665 665 666 + mutex_lock(&hba->hba_stats_mutex); 667 + 666 668 bnx2fc_stats = fc_get_host_stats(shost); 667 669 668 670 init_completion(&hba->stat_req_done); 669 671 if (bnx2fc_send_stat_req(hba)) 670 - return bnx2fc_stats; 672 + goto unlock_stats_mutex; 671 673 rc = wait_for_completion_timeout(&hba->stat_req_done, (2 * HZ)); 672 674 if (!rc) { 673 675 BNX2FC_HBA_DBG(lport, "FW stat req timed out\n"); 674 - return bnx2fc_stats; 676 + goto unlock_stats_mutex; 675 677 } 676 678 BNX2FC_STATS(hba, rx_stat2, fc_crc_cnt); 677 679 bnx2fc_stats->invalid_crc_count += hba->bfw_stats.fc_crc_cnt; ··· 695 693 696 694 memcpy(&hba->prev_stats, hba->stats_buffer, 697 695 sizeof(struct fcoe_statistics_params)); 696 + 697 + unlock_stats_mutex: 698 + mutex_unlock(&hba->hba_stats_mutex); 698 699 return bnx2fc_stats; 699 700 } 700 701 ··· 1345 1340 } 1346 1341 spin_lock_init(&hba->hba_lock); 1347 1342 mutex_init(&hba->hba_mutex); 1343 + mutex_init(&hba->hba_stats_mutex); 1348 1344 1349 1345 hba->cnic = cnic; 1350 1346
-1
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
··· 1595 1595 cxgbi_sock_put(csk); 1596 1596 } 1597 1597 csk->dst = NULL; 1598 - csk->cdev = NULL; 1599 1598 } 1600 1599 1601 1600 static int init_act_open(struct cxgbi_sock *csk)
+22 -7
drivers/scsi/cxgbi/libcxgbi.c
··· 867 867 log_debug(1 << CXGBI_DBG_SOCK, "csk 0x%p,%u,0x%lx,%u.\n", 868 868 csk, (csk)->state, (csk)->flags, (csk)->tid); 869 869 spin_lock_bh(&csk->lock); 870 - dst_confirm(csk->dst); 870 + if (csk->dst) 871 + dst_confirm(csk->dst); 871 872 data_lost = skb_queue_len(&csk->receive_queue); 872 873 __skb_queue_purge(&csk->receive_queue); 873 874 ··· 883 882 } 884 883 885 884 if (close_req) { 886 - if (data_lost) 885 + if (!cxgbi_sock_flag(csk, CTPF_LOGOUT_RSP_RCVD) || 886 + data_lost) 887 887 csk->cdev->csk_send_abort_req(csk); 888 888 else 889 889 csk->cdev->csk_send_close_req(csk); ··· 1188 1186 cxgbi_ulp_extra_len(cxgbi_skcb_ulp_mode(skb)); 1189 1187 skb = next; 1190 1188 } 1191 - done: 1189 + 1192 1190 if (likely(skb_queue_len(&csk->write_queue))) 1193 1191 cdev->csk_push_tx_frames(csk, 1); 1192 + done: 1194 1193 spin_unlock_bh(&csk->lock); 1195 1194 return copied; 1196 1195 ··· 1571 1568 } 1572 1569 } 1573 1570 1574 - static int skb_read_pdu_bhs(struct iscsi_conn *conn, struct sk_buff *skb) 1571 + static int 1572 + skb_read_pdu_bhs(struct cxgbi_sock *csk, struct iscsi_conn *conn, 1573 + struct sk_buff *skb) 1575 1574 { 1576 1575 struct iscsi_tcp_conn *tcp_conn = conn->dd_data; 1576 + int err; 1577 1577 1578 1578 log_debug(1 << CXGBI_DBG_PDU_RX, 1579 1579 "conn 0x%p, skb 0x%p, len %u, flag 0x%lx.\n", ··· 1614 1608 } 1615 1609 } 1616 1610 1617 - return read_pdu_skb(conn, skb, 0, 0); 1611 + err = read_pdu_skb(conn, skb, 0, 0); 1612 + if (likely(err >= 0)) { 1613 + struct iscsi_hdr *hdr = (struct iscsi_hdr *)skb->data; 1614 + u8 opcode = hdr->opcode & ISCSI_OPCODE_MASK; 1615 + 1616 + if (unlikely(opcode == ISCSI_OP_LOGOUT_RSP)) 1617 + cxgbi_sock_set_flag(csk, CTPF_LOGOUT_RSP_RCVD); 1618 + } 1619 + 1620 + return err; 1618 1621 } 1619 1622 1620 1623 static int skb_read_pdu_data(struct iscsi_conn *conn, struct sk_buff *lskb, ··· 1728 1713 cxgbi_skcb_rx_pdulen(skb)); 1729 1714 1730 1715 if (cxgbi_skcb_test_flag(skb, SKCBF_RX_COALESCED)) { 1731 - err = skb_read_pdu_bhs(conn, skb); 1716 + err = skb_read_pdu_bhs(csk, conn, skb); 1732 1717 if (err < 0) { 1733 1718 pr_err("coalesced bhs, csk 0x%p, skb 0x%p,%u, " 1734 1719 "f 0x%lx, plen %u.\n", ··· 1746 1731 cxgbi_skcb_flags(skb), 1747 1732 cxgbi_skcb_rx_pdulen(skb)); 1748 1733 } else { 1749 - err = skb_read_pdu_bhs(conn, skb); 1734 + err = skb_read_pdu_bhs(csk, conn, skb); 1750 1735 if (err < 0) { 1751 1736 pr_err("bhs, csk 0x%p, skb 0x%p,%u, " 1752 1737 "f 0x%lx, plen %u.\n",
+1
drivers/scsi/cxgbi/libcxgbi.h
··· 187 187 CTPF_HAS_ATID, /* reserved atid */ 188 188 CTPF_HAS_TID, /* reserved hw tid */ 189 189 CTPF_OFFLOAD_DOWN, /* offload function off */ 190 + CTPF_LOGOUT_RSP_RCVD, /* received logout response */ 190 191 }; 191 192 192 193 struct cxgbi_skb_rx_cb {
+1 -1
drivers/scsi/lpfc/lpfc_crtn.h
··· 127 127 void lpfc_do_scr_ns_plogi(struct lpfc_hba *, struct lpfc_vport *); 128 128 int lpfc_check_sparm(struct lpfc_vport *, struct lpfc_nodelist *, 129 129 struct serv_parm *, uint32_t, int); 130 - int lpfc_els_abort(struct lpfc_hba *, struct lpfc_nodelist *); 130 + void lpfc_els_abort(struct lpfc_hba *, struct lpfc_nodelist *); 131 131 void lpfc_more_plogi(struct lpfc_vport *); 132 132 void lpfc_more_adisc(struct lpfc_vport *); 133 133 void lpfc_end_rscn(struct lpfc_vport *);
+3 -2
drivers/scsi/lpfc/lpfc_ct.c
··· 978 978 ndlp, did, ndlp->nlp_fc4_type, 979 979 FC_TYPE_FCP, FC_TYPE_NVME); 980 980 ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; 981 + 982 + lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); 983 + lpfc_issue_els_prli(vport, ndlp, 0); 981 984 } 982 - lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); 983 - lpfc_issue_els_prli(vport, ndlp, 0); 984 985 } else 985 986 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, 986 987 "3065 GFT_ID failed x%08x\n", irsp->ulpStatus);
+5 -2
drivers/scsi/lpfc/lpfc_nportdisc.c
··· 206 206 * associated with a LPFC_NODELIST entry. This 207 207 * routine effectively results in a "software abort". 208 208 */ 209 - int 209 + void 210 210 lpfc_els_abort(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) 211 211 { 212 212 LIST_HEAD(abort_list); ··· 214 214 struct lpfc_iocbq *iocb, *next_iocb; 215 215 216 216 pring = lpfc_phba_elsring(phba); 217 + 218 + /* In case of error recovery path, we might have a NULL pring here */ 219 + if (!pring) 220 + return; 217 221 218 222 /* Abort outstanding I/O on NPort <nlp_DID> */ 219 223 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_DISCOVERY, ··· 277 273 IOSTAT_LOCAL_REJECT, IOERR_SLI_ABORTED); 278 274 279 275 lpfc_cancel_retry_delay_tmo(phba->pport, ndlp); 280 - return 0; 281 276 } 282 277 283 278 static int
+2 -2
drivers/scsi/lpfc/lpfc_nvmet.c
··· 799 799 } 800 800 spin_unlock_irqrestore(&ctxp->ctxlock, flags); 801 801 802 - lpfc_nvmeio_data(phba, "NVMET FCP FREE: xri x%x ste %d\n", ctxp->oxid, 803 - ctxp->state, 0); 802 + lpfc_nvmeio_data(phba, "NVMET FCP FREE: xri x%x ste %d abt %d\n", ctxp->oxid, 803 + ctxp->state, aborting); 804 804 805 805 atomic_inc(&lpfc_nvmep->xmt_fcp_release); 806 806
+5 -4
drivers/scsi/qla2xxx/qla_bsg.c
··· 730 730 return -EIO; 731 731 } 732 732 733 + memset(&elreq, 0, sizeof(elreq)); 734 + 733 735 elreq.req_sg_cnt = dma_map_sg(&ha->pdev->dev, 734 736 bsg_job->request_payload.sg_list, bsg_job->request_payload.sg_cnt, 735 737 DMA_TO_DEVICE); ··· 797 795 798 796 if (atomic_read(&vha->loop_state) == LOOP_READY && 799 797 (ha->current_topology == ISP_CFG_F || 800 - ((IS_QLA81XX(ha) || IS_QLA8031(ha) || IS_QLA8044(ha)) && 801 - le32_to_cpu(*(uint32_t *)req_data) == ELS_OPCODE_BYTE 802 - && req_data_len == MAX_ELS_FRAME_PAYLOAD)) && 803 - elreq.options == EXTERNAL_LOOPBACK) { 798 + (le32_to_cpu(*(uint32_t *)req_data) == ELS_OPCODE_BYTE && 799 + req_data_len == MAX_ELS_FRAME_PAYLOAD)) && 800 + elreq.options == EXTERNAL_LOOPBACK) { 804 801 type = "FC_BSG_HST_VENDOR_ECHO_DIAG"; 805 802 ql_dbg(ql_dbg_user, vha, 0x701e, 806 803 "BSG request type: %s.\n", type);
+2 -2
drivers/scsi/qla2xxx/qla_dbg.c
··· 1131 1131 1132 1132 /* Mailbox registers. */ 1133 1133 mbx_reg = &reg->mailbox0; 1134 - for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++, dmp_reg++) 1134 + for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++, mbx_reg++) 1135 1135 fw->mailbox_reg[cnt] = htons(RD_REG_WORD(mbx_reg)); 1136 1136 1137 1137 /* Transfer sequence registers. */ ··· 2090 2090 2091 2091 /* Mailbox registers. */ 2092 2092 mbx_reg = &reg->mailbox0; 2093 - for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++, dmp_reg++) 2093 + for (cnt = 0; cnt < sizeof(fw->mailbox_reg) / 2; cnt++, mbx_reg++) 2094 2094 fw->mailbox_reg[cnt] = htons(RD_REG_WORD(mbx_reg)); 2095 2095 2096 2096 /* Transfer sequence registers. */
+1
drivers/scsi/qla2xxx/qla_def.h
··· 3425 3425 uint8_t max_req_queues; 3426 3426 uint8_t max_rsp_queues; 3427 3427 uint8_t max_qpairs; 3428 + uint8_t num_qpairs; 3428 3429 struct qla_qpair *base_qpair; 3429 3430 struct qla_npiv_entry *npiv_info; 3430 3431 uint16_t nvram_npiv_size;
+4 -1
drivers/scsi/qla2xxx/qla_init.c
··· 7543 7543 /* Assign available que pair id */ 7544 7544 mutex_lock(&ha->mq_lock); 7545 7545 qpair_id = find_first_zero_bit(ha->qpair_qid_map, ha->max_qpairs); 7546 - if (qpair_id >= ha->max_qpairs) { 7546 + if (ha->num_qpairs >= ha->max_qpairs) { 7547 7547 mutex_unlock(&ha->mq_lock); 7548 7548 ql_log(ql_log_warn, vha, 0x0183, 7549 7549 "No resources to create additional q pair.\n"); 7550 7550 goto fail_qid_map; 7551 7551 } 7552 + ha->num_qpairs++; 7552 7553 set_bit(qpair_id, ha->qpair_qid_map); 7553 7554 ha->queue_pair_map[qpair_id] = qpair; 7554 7555 qpair->id = qpair_id; ··· 7636 7635 fail_msix: 7637 7636 ha->queue_pair_map[qpair_id] = NULL; 7638 7637 clear_bit(qpair_id, ha->qpair_qid_map); 7638 + ha->num_qpairs--; 7639 7639 mutex_unlock(&ha->mq_lock); 7640 7640 fail_qid_map: 7641 7641 kfree(qpair); ··· 7662 7660 mutex_lock(&ha->mq_lock); 7663 7661 ha->queue_pair_map[qpair->id] = NULL; 7664 7662 clear_bit(qpair->id, ha->qpair_qid_map); 7663 + ha->num_qpairs--; 7665 7664 list_del(&qpair->qp_list_elem); 7666 7665 if (list_empty(&vha->qp_list)) 7667 7666 vha->flags.qpairs_available = 0;
+7 -19
drivers/scsi/qla2xxx/qla_inline.h
··· 129 129 } 130 130 131 131 static inline void 132 - qla2x00_clean_dsd_pool(struct qla_hw_data *ha, srb_t *sp, 133 - struct qla_tgt_cmd *tc) 132 + qla2x00_clean_dsd_pool(struct qla_hw_data *ha, struct crc_context *ctx) 134 133 { 135 - struct dsd_dma *dsd_ptr, *tdsd_ptr; 136 - struct crc_context *ctx; 137 - 138 - if (sp) 139 - ctx = (struct crc_context *)GET_CMD_CTX_SP(sp); 140 - else if (tc) 141 - ctx = (struct crc_context *)tc->ctx; 142 - else { 143 - BUG(); 144 - return; 145 - } 134 + struct dsd_dma *dsd, *tdsd; 146 135 147 136 /* clean up allocated prev pool */ 148 - list_for_each_entry_safe(dsd_ptr, tdsd_ptr, 149 - &ctx->dsd_list, list) { 150 - dma_pool_free(ha->dl_dma_pool, dsd_ptr->dsd_addr, 151 - dsd_ptr->dsd_list_dma); 152 - list_del(&dsd_ptr->list); 153 - kfree(dsd_ptr); 137 + list_for_each_entry_safe(dsd, tdsd, &ctx->dsd_list, list) { 138 + dma_pool_free(ha->dl_dma_pool, dsd->dsd_addr, 139 + dsd->dsd_list_dma); 140 + list_del(&dsd->list); 141 + kfree(dsd); 154 142 } 155 143 INIT_LIST_HEAD(&ctx->dsd_list); 156 144 }
+1 -1
drivers/scsi/qla2xxx/qla_isr.c
··· 3282 3282 } 3283 3283 3284 3284 /* Enable MSI-X vector for response queue update for queue 0 */ 3285 - if (IS_QLA83XX(ha) || IS_QLA27XX(ha)) { 3285 + if (IS_QLA25XX(ha) || IS_QLA83XX(ha) || IS_QLA27XX(ha)) { 3286 3286 if (ha->msixbase && ha->mqiobase && 3287 3287 (ha->max_rsp_queues > 1 || ha->max_req_queues > 1 || 3288 3288 ql2xmqsupport))
+2 -11
drivers/scsi/qla2xxx/qla_mbx.c
··· 3676 3676 qlt_update_host_map(vha, id); 3677 3677 } 3678 3678 3679 - fc_host_port_name(vha->host) = 3680 - wwn_to_u64(vha->port_name); 3681 - 3682 - if (qla_ini_mode_enabled(vha)) 3683 - ql_dbg(ql_dbg_mbx, vha, 0x1018, 3684 - "FA-WWN portname %016llx (%x)\n", 3685 - fc_host_port_name(vha->host), 3686 - rptid_entry->vp_status); 3687 - 3688 3679 set_bit(REGISTER_FC4_NEEDED, &vha->dpc_flags); 3689 3680 set_bit(REGISTER_FDMI_NEEDED, &vha->dpc_flags); 3690 3681 } else { ··· 4812 4821 4813 4822 memset(mcp->mb, 0 , sizeof(mcp->mb)); 4814 4823 mcp->mb[0] = MBC_DIAGNOSTIC_ECHO; 4815 - mcp->mb[1] = mreq->options | BIT_6; /* BIT_6 specifies 64bit address */ 4824 + /* BIT_6 specifies 64bit address */ 4825 + mcp->mb[1] = mreq->options | BIT_15 | BIT_6; 4816 4826 if (IS_CNA_CAPABLE(ha)) { 4817 - mcp->mb[1] |= BIT_15; 4818 4827 mcp->mb[2] = vha->fcoe_fcf_idx; 4819 4828 } 4820 4829 mcp->mb[16] = LSW(mreq->rcv_dma);
+29 -17
drivers/scsi/qla2xxx/qla_os.c
··· 630 630 sp->flags &= ~SRB_CRC_PROT_DMA_VALID; 631 631 } 632 632 633 + if (!ctx) 634 + goto end; 635 + 633 636 if (sp->flags & SRB_CRC_CTX_DSD_VALID) { 634 637 /* List assured to be having elements */ 635 - qla2x00_clean_dsd_pool(ha, sp, NULL); 638 + qla2x00_clean_dsd_pool(ha, ctx); 636 639 sp->flags &= ~SRB_CRC_CTX_DSD_VALID; 637 640 } 638 641 639 642 if (sp->flags & SRB_CRC_CTX_DMA_VALID) { 640 - dma_pool_free(ha->dl_dma_pool, ctx, 641 - ((struct crc_context *)ctx)->crc_ctx_dma); 643 + struct crc_context *ctx0 = ctx; 644 + 645 + dma_pool_free(ha->dl_dma_pool, ctx0, ctx0->crc_ctx_dma); 642 646 sp->flags &= ~SRB_CRC_CTX_DMA_VALID; 643 647 } 644 648 645 649 if (sp->flags & SRB_FCP_CMND_DMA_VALID) { 646 - struct ct6_dsd *ctx1 = (struct ct6_dsd *)ctx; 650 + struct ct6_dsd *ctx1 = ctx; 647 651 648 652 dma_pool_free(ha->fcp_cmnd_dma_pool, ctx1->fcp_cmnd, 649 - ctx1->fcp_cmnd_dma); 653 + ctx1->fcp_cmnd_dma); 650 654 list_splice(&ctx1->dsd_list, &ha->gbl_dsd_list); 651 655 ha->gbl_dsd_inuse -= ctx1->dsd_use_cnt; 652 656 ha->gbl_dsd_avail += ctx1->dsd_use_cnt; 653 657 mempool_free(ctx1, ha->ctx_mempool); 654 658 } 655 659 660 + end: 656 661 CMD_SP(cmd) = NULL; 657 662 qla2x00_rel_sp(sp); 658 663 } ··· 704 699 sp->flags &= ~SRB_CRC_PROT_DMA_VALID; 705 700 } 706 701 702 + if (!ctx) 703 + goto end; 704 + 707 705 if (sp->flags & SRB_CRC_CTX_DSD_VALID) { 708 706 /* List assured to be having elements */ 709 - qla2x00_clean_dsd_pool(ha, sp, NULL); 707 + qla2x00_clean_dsd_pool(ha, ctx); 710 708 sp->flags &= ~SRB_CRC_CTX_DSD_VALID; 711 709 } 712 710 713 711 if (sp->flags & SRB_CRC_CTX_DMA_VALID) { 714 - dma_pool_free(ha->dl_dma_pool, ctx, 715 - ((struct crc_context *)ctx)->crc_ctx_dma); 712 + struct crc_context *ctx0 = ctx; 713 + 714 + dma_pool_free(ha->dl_dma_pool, ctx, ctx0->crc_ctx_dma); 716 715 sp->flags &= ~SRB_CRC_CTX_DMA_VALID; 717 716 } 718 717 719 718 if (sp->flags & SRB_FCP_CMND_DMA_VALID) { 720 - struct ct6_dsd *ctx1 = (struct ct6_dsd *)ctx; 721 - 719 + struct ct6_dsd *ctx1 = ctx; 722 720 dma_pool_free(ha->fcp_cmnd_dma_pool, ctx1->fcp_cmnd, 723 721 ctx1->fcp_cmnd_dma); 724 722 list_splice(&ctx1->dsd_list, &ha->gbl_dsd_list); ··· 729 721 ha->gbl_dsd_avail += ctx1->dsd_use_cnt; 730 722 mempool_free(ctx1, ha->ctx_mempool); 731 723 } 732 - 724 + end: 733 725 CMD_SP(cmd) = NULL; 734 726 qla2xxx_rel_qpair_sp(sp->qpair, sp); 735 727 } ··· 1640 1632 void 1641 1633 qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) 1642 1634 { 1643 - int que, cnt; 1635 + int que, cnt, status; 1644 1636 unsigned long flags; 1645 1637 srb_t *sp; 1646 1638 struct qla_hw_data *ha = vha->hw; ··· 1670 1662 */ 1671 1663 sp_get(sp); 1672 1664 spin_unlock_irqrestore(&ha->hardware_lock, flags); 1673 - qla2xxx_eh_abort(GET_CMD_SP(sp)); 1665 + status = qla2xxx_eh_abort(GET_CMD_SP(sp)); 1674 1666 spin_lock_irqsave(&ha->hardware_lock, flags); 1667 + /* Get rid of extra reference if immediate exit 1668 + * from ql2xxx_eh_abort */ 1669 + if (status == FAILED && (qla2x00_isp_reg_stat(ha))) 1670 + atomic_dec(&sp->ref_count); 1675 1671 } 1676 1672 req->outstanding_cmds[cnt] = NULL; 1677 1673 sp->done(sp, res); ··· 2635 2623 2636 2624 if (mem_only) { 2637 2625 if (pci_enable_device_mem(pdev)) 2638 - goto probe_out; 2626 + return ret; 2639 2627 } else { 2640 2628 if (pci_enable_device(pdev)) 2641 - goto probe_out; 2629 + return ret; 2642 2630 } 2643 2631 2644 2632 /* This may fail but that's ok */ ··· 2648 2636 if (!ha) { 2649 2637 ql_log_pci(ql_log_fatal, pdev, 0x0009, 2650 2638 "Unable to allocate memory for ha.\n"); 2651 - goto probe_out; 2639 + goto disable_device; 2652 2640 } 2653 2641 ql_dbg_pci(ql_dbg_init, pdev, 0x000a, 2654 2642 "Memory allocated for ha=%p.\n", ha); ··· 3266 3254 pci_release_selected_regions(ha->pdev, ha->bars); 3267 3255 kfree(ha); 3268 3256 3269 - probe_out: 3257 + disable_device: 3270 3258 pci_disable_device(pdev); 3271 3259 return ret; 3272 3260 }
+6 -4
drivers/scsi/qla2xxx/qla_target.c
··· 2245 2245 pci_unmap_sg(ha->pdev, cmd->prot_sg, cmd->prot_sg_cnt, 2246 2246 cmd->dma_data_direction); 2247 2247 2248 - if (cmd->ctx_dsd_alloced) 2249 - qla2x00_clean_dsd_pool(ha, NULL, cmd); 2248 + if (!cmd->ctx) 2249 + return; 2250 2250 2251 - if (cmd->ctx) 2252 - dma_pool_free(ha->dl_dma_pool, cmd->ctx, cmd->ctx->crc_ctx_dma); 2251 + if (cmd->ctx_dsd_alloced) 2252 + qla2x00_clean_dsd_pool(ha, cmd->ctx); 2253 + 2254 + dma_pool_free(ha->dl_dma_pool, cmd->ctx, cmd->ctx->crc_ctx_dma); 2253 2255 } 2254 2256 2255 2257 static int qlt_check_reserve_free_req(struct scsi_qla_host *vha,
+1 -1
drivers/scsi/qla2xxx/qla_tmpl.c
··· 371 371 goto done; 372 372 } 373 373 374 - if (end <= start || start == 0 || end == 0) { 374 + if (end < start || start == 0 || end == 0) { 375 375 ql_dbg(ql_dbg_misc, vha, 0xd023, 376 376 "%s: unusable range (start=%x end=%x)\n", __func__, 377 377 ent->t262.end_addr, ent->t262.start_addr);
+1 -1
drivers/scsi/scsi_debug.c
··· 1404 1404 arr[4] = SDEBUG_LONG_INQ_SZ - 5; 1405 1405 arr[5] = (int)have_dif_prot; /* PROTECT bit */ 1406 1406 if (sdebug_vpd_use_hostno == 0) 1407 - arr[5] = 0x10; /* claim: implicit TGPS */ 1407 + arr[5] |= 0x10; /* claim: implicit TPGS */ 1408 1408 arr[6] = 0x10; /* claim: MultiP */ 1409 1409 /* arr[6] |= 0x40; ... claim: EncServ (enclosure services) */ 1410 1410 arr[7] = 0xa; /* claim: LINKED + CMDQUE */