[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SJ2PR11MB83691484F9F6DAD3F347EA2BE19BA@SJ2PR11MB8369.namprd11.prod.outlook.com>
Date: Tue, 3 Feb 2026 19:54:40 +0000
From: <Don.Brace@...rochip.com>
To: <zilin@....edu.cn>
CC: <James.Bottomley@...senPartnership.com>, <martin.petersen@...cle.com>,
<Scott.Teel@...rochip.com>, <john.p.donnelly@...cle.com>,
<Scott.Benesh@...rochip.com>, <Mike.McGowen@...rochip.com>,
<storagedev@...rochip.com>, <linux-scsi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <jianhao.xu@....edu.cn>
Subject: Re: [PATCH] scsi: smartpqi: fix memory leak in pqi_report_phys_luns()
________________________________________
From: Zilin Guan <zilin@....edu.cn>
Sent: Saturday, January 31, 2026 3:36 AM
To: Don Brace - C33706 <Don.Brace@...rochip.com>
Cc: James.Bottomley@...senPartnership.com <James.Bottomley@...senPartnership.com>; martin.petersen@...cle.com <martin.petersen@...cle.com>; Scott Teel - C33730 <Scott.Teel@...rochip.com>; john.p.donnelly@...cle.com <john.p.donnelly@...cle.com>; Scott Benesh - C33703 <Scott.Benesh@...rochip.com>; Mike McGowen - C62625 <Mike.McGowen@...rochip.com>; storagedev <storagedev@...rochip.com>; linux-scsi@...r.kernel.org <linux-scsi@...r.kernel.org>; linux-kernel@...r.kernel.org <linux-kernel@...r.kernel.org>; jianhao.xu@....edu.cn <jianhao.xu@....edu.cn>; Zilin Guan <zilin@....edu.cn>
Subject: [PATCH] scsi: smartpqi: fix memory leak in pqi_report_phys_luns()
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
pqi_report_phys_luns() fails to release the rpl_list buffer when
encountering an unsupported data format or when the allocation for
rpl_16byte_wwid_list fails. These early returns bypass the cleanup
logic, leading to memory leaks.
Consolidate the error handling by adding an out_free_rpl_list label
and use goto statements to ensure rpl_list is consistently freed
on failure.
Compile tested only. Issue found using a prototype static analysis tool
and code review.
Fixes: 28ca6d876c5a ("scsi: smartpqi: Add extended report physical LUNs")
Signed-off-by: Zilin Guan <zilin@....edu.cn>
Thanks for your patch. Like the minimal change.
Tested-by: Don Brace <don.brace@...rochip.com>
Acked-by: Don Brace <don.brace@...rochip.com>
Powered by blists - more mailing lists