Commit 5fc136f3 authored by Martin K. Petersen's avatar Martin K. Petersen

Merge patch series "qla2xxx klocwork fixes"

Nilesh Javali <njavali@marvell.com> says:

Please apply the qla2xxx driver klocwork fixes to the scsi tree at
your earliest convenience.

Link: https://lore.kernel.org/r/20230607113843.37185-1-njavali@marvell.comSigned-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parents 51031cc3 991e7ac6
...@@ -283,6 +283,10 @@ qla2x00_process_els(struct bsg_job *bsg_job) ...@@ -283,6 +283,10 @@ qla2x00_process_els(struct bsg_job *bsg_job)
if (bsg_request->msgcode == FC_BSG_RPT_ELS) { if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
rport = fc_bsg_to_rport(bsg_job); rport = fc_bsg_to_rport(bsg_job);
if (!rport) {
rval = -ENOMEM;
goto done;
}
fcport = *(fc_port_t **) rport->dd_data; fcport = *(fc_port_t **) rport->dd_data;
host = rport_to_shost(rport); host = rport_to_shost(rport);
vha = shost_priv(host); vha = shost_priv(host);
...@@ -2992,6 +2996,8 @@ qla24xx_bsg_request(struct bsg_job *bsg_job) ...@@ -2992,6 +2996,8 @@ qla24xx_bsg_request(struct bsg_job *bsg_job)
if (bsg_request->msgcode == FC_BSG_RPT_ELS) { if (bsg_request->msgcode == FC_BSG_RPT_ELS) {
rport = fc_bsg_to_rport(bsg_job); rport = fc_bsg_to_rport(bsg_job);
if (!rport)
return ret;
host = rport_to_shost(rport); host = rport_to_shost(rport);
vha = shost_priv(host); vha = shost_priv(host);
} else { } else {
......
...@@ -2362,7 +2362,7 @@ qla24xx_issue_sa_replace_iocb(scsi_qla_host_t *vha, struct qla_work_evt *e) ...@@ -2362,7 +2362,7 @@ qla24xx_issue_sa_replace_iocb(scsi_qla_host_t *vha, struct qla_work_evt *e)
ql_dbg(ql_dbg_edif, vha, 0x70e6, ql_dbg(ql_dbg_edif, vha, 0x70e6,
"sa_ctl allocation failed\n"); "sa_ctl allocation failed\n");
rval = -ENOMEM; rval = -ENOMEM;
goto done; return rval;
} }
fcport = sa_ctl->fcport; fcport = sa_ctl->fcport;
......
...@@ -5549,7 +5549,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha) ...@@ -5549,7 +5549,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha)
__be32 *q; __be32 *q;
memset(ha->init_cb, 0, ha->init_cb_size); memset(ha->init_cb, 0, ha->init_cb_size);
sz = min_t(int, sizeof(struct fc_els_flogi), ha->init_cb_size); sz = min_t(int, sizeof(struct fc_els_csp), ha->init_cb_size);
rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma, rval = qla24xx_get_port_login_templ(vha, ha->init_cb_dma,
ha->init_cb, sz); ha->init_cb, sz);
if (rval != QLA_SUCCESS) { if (rval != QLA_SUCCESS) {
......
...@@ -109,11 +109,13 @@ qla2x00_set_fcport_disc_state(fc_port_t *fcport, int state) ...@@ -109,11 +109,13 @@ qla2x00_set_fcport_disc_state(fc_port_t *fcport, int state)
{ {
int old_val; int old_val;
uint8_t shiftbits, mask; uint8_t shiftbits, mask;
uint8_t port_dstate_str_sz;
/* This will have to change when the max no. of states > 16 */ /* This will have to change when the max no. of states > 16 */
shiftbits = 4; shiftbits = 4;
mask = (1 << shiftbits) - 1; mask = (1 << shiftbits) - 1;
port_dstate_str_sz = sizeof(port_dstate_str) / sizeof(char *);
fcport->disc_state = state; fcport->disc_state = state;
while (1) { while (1) {
old_val = atomic_read(&fcport->shadow_disc_state); old_val = atomic_read(&fcport->shadow_disc_state);
...@@ -121,7 +123,8 @@ qla2x00_set_fcport_disc_state(fc_port_t *fcport, int state) ...@@ -121,7 +123,8 @@ qla2x00_set_fcport_disc_state(fc_port_t *fcport, int state)
old_val, (old_val << shiftbits) | state)) { old_val, (old_val << shiftbits) | state)) {
ql_dbg(ql_dbg_disc, fcport->vha, 0x2134, ql_dbg(ql_dbg_disc, fcport->vha, 0x2134,
"FCPort %8phC disc_state transition: %s to %s - portid=%06x.\n", "FCPort %8phC disc_state transition: %s to %s - portid=%06x.\n",
fcport->port_name, port_dstate_str[old_val & mask], fcport->port_name, (old_val & mask) < port_dstate_str_sz ?
port_dstate_str[old_val & mask] : "Unknown",
port_dstate_str[state], fcport->d_id.b24); port_dstate_str[state], fcport->d_id.b24);
return; return;
} }
......
...@@ -607,7 +607,8 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt, ...@@ -607,7 +607,8 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt,
put_unaligned_le32(COMMAND_TYPE_6, &cmd_pkt->entry_type); put_unaligned_le32(COMMAND_TYPE_6, &cmd_pkt->entry_type);
/* No data transfer */ /* No data transfer */
if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) { if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE ||
tot_dsds == 0) {
cmd_pkt->byte_count = cpu_to_le32(0); cmd_pkt->byte_count = cpu_to_le32(0);
return 0; return 0;
} }
......
...@@ -5088,7 +5088,8 @@ struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *sht, ...@@ -5088,7 +5088,8 @@ struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *sht,
} }
INIT_DELAYED_WORK(&vha->scan.scan_work, qla_scan_work_fn); INIT_DELAYED_WORK(&vha->scan.scan_work, qla_scan_work_fn);
sprintf(vha->host_str, "%s_%lu", QLA2XXX_DRIVER_NAME, vha->host_no); snprintf(vha->host_str, sizeof(vha->host_str), "%s_%lu",
QLA2XXX_DRIVER_NAME, vha->host_no);
ql_dbg(ql_dbg_init, vha, 0x0041, ql_dbg(ql_dbg_init, vha, 0x0041,
"Allocated the host=%p hw=%p vha=%p dev_name=%s", "Allocated the host=%p hw=%p vha=%p dev_name=%s",
vha->host, vha->hw, vha, vha->host, vha->hw, vha,
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
/* /*
* Driver version * Driver version
*/ */
#define QLA2XXX_VERSION "10.02.08.300-k" #define QLA2XXX_VERSION "10.02.08.400-k"
#define QLA_DRIVER_MAJOR_VER 10 #define QLA_DRIVER_MAJOR_VER 10
#define QLA_DRIVER_MINOR_VER 2 #define QLA_DRIVER_MINOR_VER 2
#define QLA_DRIVER_PATCH_VER 8 #define QLA_DRIVER_PATCH_VER 8
#define QLA_DRIVER_BETA_VER 300 #define QLA_DRIVER_BETA_VER 400
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment