Showing error 747

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_hbadisc.c
Line in file: 300
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Smatch (1.59)
Entered: 2011-11-07 22:22:22 UTC


Source:

 270
 271        if (!(vport->load_flag & FC_UNLOADING) &&
 272            !(ndlp->nlp_flag & NLP_DELAY_TMO) &&
 273            !(ndlp->nlp_flag & NLP_NPR_2B_DISC) &&
 274            (ndlp->nlp_state != NLP_STE_UNMAPPED_NODE))
 275                lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM);
 276}
 277
 278/**
 279 * lpfc_alloc_fast_evt: Allocates data structure for posting event.
 280 * @phba: Pointer to hba context object.
 281 *
 282 * This function is called from the functions which need to post
 283 * events from interrupt context. This function allocates data
 284 * structure required for posting event. It also keeps track of
 285 * number of events pending and prevent event storm when there are
 286 * too many events.
 287 **/
 288struct lpfc_fast_path_event *
 289lpfc_alloc_fast_evt(struct lpfc_hba *phba) {
 290        struct lpfc_fast_path_event *ret;
 291
 292        /* If there are lot of fast event do not exhaust memory due to this */
 293        if (atomic_read(&phba->fast_event_count) > LPFC_MAX_EVT_COUNT)
 294                return NULL;
 295
 296        ret = kzalloc(sizeof(struct lpfc_fast_path_event),
 297                        GFP_ATOMIC);
 298        if (ret)
 299                atomic_inc(&phba->fast_event_count);
 300        INIT_LIST_HEAD(&ret->work_evt.evt_listp);
 301        ret->work_evt.evt = LPFC_EVT_FASTPATH_MGMT_EVT;
 302        return ret;
 303}
 304
 305/**
 306 * lpfc_free_fast_evt: Frees event data structure.
 307 * @phba: Pointer to hba context object.
 308 * @evt:  Event object which need to be freed.
 309 *
 310 * This function frees the data structure required for posting
Show full sources