Re: [PATCH 2/2] cdx: Fix double free when sysfs file creation fails

From: Prasanna Kumar T S M

Date: Mon Apr 27 2026 - 03:10:44 EST


Hi Nipun,

On 01-04-2026 15:12, Gupta, Nipun wrote:


On 20-03-2026 15:51, Prasanna Kumar T S M wrote:
In cdx_create_res_attr(), if sysfs_create_bin_file() fails, the code
frees res_attr but doesn't set cdx_dev->res_attr[num] to NULL. This
leaves a dangling pointer in the array. Then cdx_destroy_res_attr()
frees the already-freed memory. Fix the double free by initializing
cdx_dev->res_attr[num] after sysfs_create_bin_file() completes.

Fixes: aeda33ab8160 ("cdx: create sysfs bin files for cdx resources")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Prasanna Kumar T S M <ptsm@xxxxxxxxxxxxxxxxxxx>

Acked-by: Nipun Gupta <nipun.gupta@xxxxxxx>

I am not able to see this patch in linux-next, although I can see the other patch.

Is this patch still on track for merging?

Thanks,
Prasanna Kumar