CC: [email protected]
BCC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: James Smart <[email protected]>
TO: [email protected]
CC: James Smart <[email protected]>
CC: Justin Tee <[email protected]>

Hi James,

I love your patch! Perhaps something to improve:

[auto build test WARNING on jejb-scsi/for-next]
[also build test WARNING on mkp-scsi/for-next v5.18-rc3 next-20220414]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/intel-lab-lkp/linux/commits/James-Smart/lpfc-Update-lpfc-to-revision-14-2-0-2/20220413-073746
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
:::::: branch date: 6 days ago
:::::: commit date: 6 days ago
config: x86_64-randconfig-m001-20220418 
(https://download.01.org/0day-ci/archive/20220419/[email protected]/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
drivers/scsi/lpfc/lpfc_sli.c:22305 lpfc_sli_prep_wqe() error: we previously 
assumed 'ndlp' could be null (see line 22298)

vim +/ndlp +22305 drivers/scsi/lpfc/lpfc_sli.c

561341425bcc70 James Smart 2022-02-24  22228  
561341425bcc70 James Smart 2022-02-24  22229  /**
561341425bcc70 James Smart 2022-02-24  22230   * lpfc_sli_prep_wqe - Prepare 
WQE for the command to be posted
561341425bcc70 James Smart 2022-02-24  22231   * @phba: phba object
561341425bcc70 James Smart 2022-02-24  22232   * @job: job entry of the command 
to be posted.
561341425bcc70 James Smart 2022-02-24  22233   *
561341425bcc70 James Smart 2022-02-24  22234   * Fill the common fields of the 
wqe for each of the command.
561341425bcc70 James Smart 2022-02-24  22235   *
561341425bcc70 James Smart 2022-02-24  22236   * Return codes:
561341425bcc70 James Smart 2022-02-24  22237   *        None
561341425bcc70 James Smart 2022-02-24  22238   **/
561341425bcc70 James Smart 2022-02-24  22239  void
561341425bcc70 James Smart 2022-02-24  22240  lpfc_sli_prep_wqe(struct lpfc_hba 
*phba, struct lpfc_iocbq *job)
561341425bcc70 James Smart 2022-02-24  22241  {
561341425bcc70 James Smart 2022-02-24  22242    u8 cmnd;
561341425bcc70 James Smart 2022-02-24  22243    u32 *pcmd;
561341425bcc70 James Smart 2022-02-24  22244    u32 if_type = 0;
561341425bcc70 James Smart 2022-02-24  22245    u32 fip, abort_tag;
561341425bcc70 James Smart 2022-02-24  22246    struct lpfc_nodelist *ndlp = 
NULL;
561341425bcc70 James Smart 2022-02-24  22247    union lpfc_wqe128 *wqe = 
&job->wqe;
561341425bcc70 James Smart 2022-02-24  22248    u32 els_id = 
LPFC_ELS_ID_DEFAULT;
561341425bcc70 James Smart 2022-02-24  22249    u8 command_type = 
ELS_COMMAND_NON_FIP;
561341425bcc70 James Smart 2022-02-24  22250  
561341425bcc70 James Smart 2022-02-24  22251    fip = phba->hba_flag & 
HBA_FIP_SUPPORT;
561341425bcc70 James Smart 2022-02-24  22252    /* The fcp commands will set 
command type */
561341425bcc70 James Smart 2022-02-24  22253    if (job->cmd_flag &  
LPFC_IO_FCP)
561341425bcc70 James Smart 2022-02-24  22254            command_type = 
FCP_COMMAND;
561341425bcc70 James Smart 2022-02-24  22255    else if (fip && (job->cmd_flag 
& LPFC_FIP_ELS_ID_MASK))
561341425bcc70 James Smart 2022-02-24  22256            command_type = 
ELS_COMMAND_FIP;
561341425bcc70 James Smart 2022-02-24  22257    else
561341425bcc70 James Smart 2022-02-24  22258            command_type = 
ELS_COMMAND_NON_FIP;
561341425bcc70 James Smart 2022-02-24  22259  
561341425bcc70 James Smart 2022-02-24  22260    abort_tag = job->iotag;
561341425bcc70 James Smart 2022-02-24  22261    cmnd = bf_get(wqe_cmnd, 
&wqe->els_req.wqe_com);
561341425bcc70 James Smart 2022-02-24  22262  
561341425bcc70 James Smart 2022-02-24  22263    switch (cmnd) {
561341425bcc70 James Smart 2022-02-24  22264    case CMD_ELS_REQUEST64_WQE:
536304e3919a95 James Smart 2022-04-12  22265            ndlp = job->ndlp;
561341425bcc70 James Smart 2022-02-24  22266  
561341425bcc70 James Smart 2022-02-24  22267            /* CCP CCPE PV PRI in 
word10 were set in the memcpy */
561341425bcc70 James Smart 2022-02-24  22268            if (command_type == 
ELS_COMMAND_FIP)
561341425bcc70 James Smart 2022-02-24  22269                    els_id = 
((job->cmd_flag & LPFC_FIP_ELS_ID_MASK)
561341425bcc70 James Smart 2022-02-24  22270                              >> 
LPFC_FIP_ELS_ID_SHIFT);
561341425bcc70 James Smart 2022-02-24  22271  
561341425bcc70 James Smart 2022-02-24  22272            if_type = 
bf_get(lpfc_sli_intf_if_type,
561341425bcc70 James Smart 2022-02-24  22273                             
&phba->sli4_hba.sli_intf);
561341425bcc70 James Smart 2022-02-24  22274            if (if_type >= 
LPFC_SLI_INTF_IF_TYPE_2) {
536304e3919a95 James Smart 2022-04-12  22275                    pcmd = (u32 
*)job->cmd_dmabuf->virt;
561341425bcc70 James Smart 2022-02-24  22276                    if (pcmd && 
(*pcmd == ELS_CMD_FLOGI ||
561341425bcc70 James Smart 2022-02-24  22277                                 
*pcmd == ELS_CMD_SCR ||
561341425bcc70 James Smart 2022-02-24  22278                                 
*pcmd == ELS_CMD_RDF ||
561341425bcc70 James Smart 2022-02-24  22279                                 
*pcmd == ELS_CMD_EDC ||
561341425bcc70 James Smart 2022-02-24  22280                                 
*pcmd == ELS_CMD_RSCN_XMT ||
561341425bcc70 James Smart 2022-02-24  22281                                 
*pcmd == ELS_CMD_FDISC ||
561341425bcc70 James Smart 2022-02-24  22282                                 
*pcmd == ELS_CMD_LOGO ||
561341425bcc70 James Smart 2022-02-24  22283                                 
*pcmd == ELS_CMD_QFPA ||
561341425bcc70 James Smart 2022-02-24  22284                                 
*pcmd == ELS_CMD_UVEM ||
561341425bcc70 James Smart 2022-02-24  22285                                 
*pcmd == ELS_CMD_PLOGI)) {
561341425bcc70 James Smart 2022-02-24  22286                            
bf_set(els_req64_sp, &wqe->els_req, 1);
561341425bcc70 James Smart 2022-02-24  22287                            
bf_set(els_req64_sid, &wqe->els_req,
561341425bcc70 James Smart 2022-02-24  22288                                   
job->vport->fc_myDID);
561341425bcc70 James Smart 2022-02-24  22289  
561341425bcc70 James Smart 2022-02-24  22290                            if 
((*pcmd == ELS_CMD_FLOGI) &&
561341425bcc70 James Smart 2022-02-24  22291                                
!(phba->fc_topology ==
561341425bcc70 James Smart 2022-02-24  22292                                  
LPFC_TOPOLOGY_LOOP))
561341425bcc70 James Smart 2022-02-24  22293                                    
bf_set(els_req64_sid, &wqe->els_req, 0);
561341425bcc70 James Smart 2022-02-24  22294  
561341425bcc70 James Smart 2022-02-24  22295                            
bf_set(wqe_ct, &wqe->els_req.wqe_com, 1);
561341425bcc70 James Smart 2022-02-24  22296                            
bf_set(wqe_ctxt_tag, &wqe->els_req.wqe_com,
561341425bcc70 James Smart 2022-02-24  22297                                   
phba->vpi_ids[job->vport->vpi]);
536304e3919a95 James Smart 2022-04-12 @22298                    } else if (pcmd 
&& ndlp) {
561341425bcc70 James Smart 2022-02-24  22299                            
bf_set(wqe_ct, &wqe->els_req.wqe_com, 0);
561341425bcc70 James Smart 2022-02-24  22300                            
bf_set(wqe_ctxt_tag, &wqe->els_req.wqe_com,
561341425bcc70 James Smart 2022-02-24  22301                                   
phba->sli4_hba.rpi_ids[ndlp->nlp_rpi]);
561341425bcc70 James Smart 2022-02-24  22302                    }
561341425bcc70 James Smart 2022-02-24  22303            }
561341425bcc70 James Smart 2022-02-24  22304  
561341425bcc70 James Smart 2022-02-24 @22305            bf_set(wqe_temp_rpi, 
&wqe->els_req.wqe_com,

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to