Showing error 1843

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/scsi/lpfc/lpfc_els.c
Line in file: 2461
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

2431        uint32_t *elscmd;
2432        struct ls_rjt stat;
2433        int retry = 0, maxretry = lpfc_max_els_tries, delay = 0;
2434        int logerr = 0;
2435        uint32_t cmd = 0;
2436        uint32_t did;
2437
2438
2439        /* Note: context2 may be 0 for internal driver abort
2440         * of delays ELS command.
2441         */
2442
2443        if (pcmd && pcmd->virt) {
2444                elscmd = (uint32_t *) (pcmd->virt);
2445                cmd = *elscmd++;
2446        }
2447
2448        if (ndlp && NLP_CHK_NODE_ACT(ndlp))
2449                did = ndlp->nlp_DID;
2450        else {
2451                /* We should only hit this case for retrying PLOGI */
2452                did = irsp->un.elsreq64.remoteID;
2453                ndlp = lpfc_findnode_did(vport, did);
2454                if ((!ndlp || !NLP_CHK_NODE_ACT(ndlp))
2455                    && (cmd != ELS_CMD_PLOGI))
2456                        return 1;
2457        }
2458
2459        lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD,
2460                "Retry ELS:       wd7:x%x wd4:x%x did:x%x",
2461                *(((uint32_t *) irsp) + 7), irsp->un.ulpWord[4], ndlp->nlp_DID);
2462
2463        switch (irsp->ulpStatus) {
2464        case IOSTAT_FCP_RSP_ERROR:
2465        case IOSTAT_REMOTE_STOP:
2466                break;
2467
2468        case IOSTAT_LOCAL_REJECT:
2469                switch ((irsp->un.ulpWord[4] & 0xff)) {
2470                case IOERR_LOOP_OPEN_FAILURE:
2471                        if (cmd == ELS_CMD_PLOGI && cmdiocb->retry == 0)
Show full sources