Re: [PATCH v2] scsi: hpsa: Fix memory leak in hpsa_undo_allocations_after_kdump_soft_reset()
From: Zilin Guan
Date: Sat Jan 03 2026 - 07:39:30 EST
On Wed, Dec 31, 2025 at 05:25:23PM +0100, Markus Elfring wrote:
> …
> > +++ b/drivers/scsi/hpsa.c
> > @@ -8212,6 +8212,7 @@ static void hpsa_undo_allocations_after_kdump_soft_reset(struct ctlr_info *h)
> > h->monitor_ctlr_wq = NULL;
> > }
> >
> > + kfree(h->reply_map); /* init_one 1 */
> > kfree(h); /* init_one 1 */
> > }
>
> I wonder about the alignment and relevance for these code comments.
>
> Regards,
> Markus
Hi Markus,
Thank you for your review.
Regarding the alignment, it was an oversight caused by the inconsistency
between my editor configuration and the Linux kernel's style. I will
correct this in v3.
As for the code comment, it indicates that the memory being freed here
was allocated during the first stage of initialization in
hpsa_init_one(). I included it to maintain consistency with the existing
kfree(h) line immediately following it.
Best regards,
Zilin Guan