diff options
author | James Smart <jsmart2021@gmail.com> | 2022-04-12 15:20:03 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-04-18 22:48:47 -0400 |
commit | ef47575fd982c7ed1993fbe104909722afa1994b (patch) | |
tree | dc8fb1219dec4ecaacd50d2ba023e4d3e3bc0896 /drivers/scsi/lpfc/lpfc.h | |
parent | d51cf5bd926c7d00bd8a77fc39db73766fbf2a27 (diff) | |
download | lwn-ef47575fd982c7ed1993fbe104909722afa1994b.tar.gz lwn-ef47575fd982c7ed1993fbe104909722afa1994b.zip |
scsi: lpfc: Refactor cleanup of mailbox commands
The intention of this patch is to refactor mailbox memory allocation and
cleanup steps in one routine respectively to prevent memory leaks or memory
errors related to mailbox commands. There are trivial localized fixes as
well.
Provide lpfc_mbox_rsrc_prep() - this routine allocates the dmabuf and the
mbuf associated with it. It also catches allocation errors and returns
status.
Provide lpfc_mbox_rsrc_cleanup() - this routine verifies a dmabuf exists
and if so releases the associated mbuf and the dmabuf memory. It then sets
the ctx_buf to NULL and releases the mailbox memory to the mailbox pool.
Link: https://lore.kernel.org/r/20220412222008.126521-22-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc.h')
0 files changed, 0 insertions, 0 deletions