scsi: ufs: ufshpb: Fix possible memory leak
authorKeoseong Park <keosung.park@samsung.com>
Mon, 23 Aug 2021 09:07:14 +0000 (18:07 +0900)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 25 Aug 2021 02:56:32 +0000 (22:56 -0400)
commit6c9783e6296e8c7bf45464c00a52c457b4c321b5
tree60f205dba9ff5dbeee0f5032a4627f08e9cb3105
parent1259d5f0f5ef1ce39463b9cf3db7a1757acbeb69
scsi: ufs: ufshpb: Fix possible memory leak

When HPB pinned region exists and mctx allocation for this region fails, a
memory leak is possible because memory is not released for the subregion
table of the current region.

Free memory for the subregion table of the current region.

Link: https://lore.kernel.org/r/1891546521.01629711601304.JavaMail.epsvc@epcpadp3
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Keoseong Park <keosung.park@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshpb.c