mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 12:30:23 +09:00
scsi: bfa: release allocated memory in case of error
commit 0e62395da2 upstream.
In bfad_im_get_stats if bfa_port_get_stats fails, allocated memory needs to
be released.
Link: https://lore.kernel.org/r/20190910234417.22151-1-navid.emamdoost@gmail.com
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f2bde0e998
commit
486f512015
@@ -283,8 +283,10 @@ bfad_im_get_stats(struct Scsi_Host *shost)
|
||||
rc = bfa_port_get_stats(BFA_FCPORT(&bfad->bfa),
|
||||
fcstats, bfad_hcb_comp, &fcomp);
|
||||
spin_unlock_irqrestore(&bfad->bfad_lock, flags);
|
||||
if (rc != BFA_STATUS_OK)
|
||||
if (rc != BFA_STATUS_OK) {
|
||||
kfree(fcstats);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wait_for_completion(&fcomp.comp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user