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: | 2744 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Cppcheck
(1.59)
|
Entered: | 2013-10-17 18:38:34 UTC |
2714 cmd, did, cmdiocb->retry, irsp->ulpStatus, 2715 irsp->un.ulpWord[4]); 2716 } 2717 return 0; 2718} 2719 2720/** 2721 * lpfc_els_free_data: Free lpfc dma buffer and data structure with an iocb. 2722 * @phba: pointer to lpfc hba data structure. 2723 * @buf_ptr1: pointer to the lpfc DMA buffer data structure. 2724 * 2725 * This routine releases the lpfc DMA (Direct Memory Access) buffer(s) 2726 * associated with a command IOCB back to the lpfc DMA buffer pool. It first 2727 * checks to see whether there is a lpfc DMA buffer associated with the 2728 * response of the command IOCB. If so, it will be released before releasing 2729 * the lpfc DMA buffer associated with the IOCB itself. 2730 * 2731 * Return code 2732 * 0 - Successfully released lpfc DMA buffer (currently, always return 0) 2733 **/ 2734static int 2735lpfc_els_free_data(struct lpfc_hba *phba, struct lpfc_dmabuf *buf_ptr1) 2736{ 2737 struct lpfc_dmabuf *buf_ptr; 2738 2739 /* Free the response before processing the command. */ 2740 if (!list_empty(&buf_ptr1->list)) { 2741 list_remove_head(&buf_ptr1->list, buf_ptr, 2742 struct lpfc_dmabuf, 2743 list); 2744 lpfc_mbuf_free(phba, buf_ptr->virt, buf_ptr->phys); 2745 kfree(buf_ptr); 2746 } 2747 lpfc_mbuf_free(phba, buf_ptr1->virt, buf_ptr1->phys); 2748 kfree(buf_ptr1); 2749 return 0; 2750} 2751 2752/** 2753 * lpfc_els_free_bpl: Free lpfc dma buffer and data structure with bpl. 2754 * @phba: pointer to lpfc hba data structure.