diff mbox

Set elsiocb contexts to NULL after freeing it

Message ID 20170110110554.13770-1-jthumshirn@suse.de (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Johannes Thumshirn Jan. 10, 2017, 11:05 a.m. UTC
Set the elsiocb contexts to NULL after freeing as others depend on it.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
 drivers/scsi/lpfc/lpfc_els.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Johannes Thumshirn Jan. 13, 2017, 3:21 p.m. UTC | #1
[+Cc James S. I'm sorry]

On Tue, Jan 10, 2017 at 12:05:54PM +0100, Johannes Thumshirn wrote:
> Set the elsiocb contexts to NULL after freeing as others depend on it.
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
>  drivers/scsi/lpfc/lpfc_els.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
> index 236e4e5..7b6bd8e 100644
> --- a/drivers/scsi/lpfc/lpfc_els.c
> +++ b/drivers/scsi/lpfc/lpfc_els.c
> @@ -3590,12 +3590,14 @@ lpfc_els_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *elsiocb)
>  		} else {
>  			buf_ptr1 = (struct lpfc_dmabuf *) elsiocb->context2;
>  			lpfc_els_free_data(phba, buf_ptr1);
> +			elsiocb->context2 = NULL;
>  		}
>  	}
>  
>  	if (elsiocb->context3) {
>  		buf_ptr = (struct lpfc_dmabuf *) elsiocb->context3;
>  		lpfc_els_free_bpl(phba, buf_ptr);
> +		elsiocb->context3 = NULL;
>  	}
>  	lpfc_sli_release_iocbq(phba, elsiocb);
>  	return 0;

Dick, James, any comments? I'd really like to get this in soon as it solves
customer issues.

Byte,
	Johannes
Martin K. Petersen Jan. 17, 2017, 7:02 p.m. UTC | #2
>>>>> "Johannes" == Johannes Thumshirn <jthumshirn@suse.de> writes:

Johannes> Dick, James, any comments? I'd really like to get this in soon
Johannes> as it solves customer issues.

Ping?
Martin K. Petersen Jan. 20, 2017, 9:51 p.m. UTC | #3
>>>>> "Johannes" == Johannes Thumshirn <jthumshirn@suse.de> writes:

Johannes> Set the elsiocb contexts to NULL after freeing as others
Johannes> depend on it.

Applied to 4.11/scsi-queue.
Martin K. Petersen Jan. 20, 2017, 9:54 p.m. UTC | #4
>>>>> "Martin" == Martin K Petersen <martin.petersen@oracle.com> writes:

>>>>> "Johannes" == Johannes Thumshirn <jthumshirn@suse.de> writes:
Johannes> Set the elsiocb contexts to NULL after freeing as others
Johannes> depend on it.

Martin> Applied to 4.11/scsi-queue.

Replied to the wrong mail, sorry. This fix is already upstream.
diff mbox

Patch

diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 236e4e5..7b6bd8e 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -3590,12 +3590,14 @@  lpfc_els_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *elsiocb)
 		} else {
 			buf_ptr1 = (struct lpfc_dmabuf *) elsiocb->context2;
 			lpfc_els_free_data(phba, buf_ptr1);
+			elsiocb->context2 = NULL;
 		}
 	}
 
 	if (elsiocb->context3) {
 		buf_ptr = (struct lpfc_dmabuf *) elsiocb->context3;
 		lpfc_els_free_bpl(phba, buf_ptr);
+		elsiocb->context3 = NULL;
 	}
 	lpfc_sli_release_iocbq(phba, elsiocb);
 	return 0;