diff options
| author | Zheng Qixing <[email protected]> | 2024-08-22 03:30:50 +0000 |
|---|---|---|
| committer | Damien Le Moal <[email protected]> | 2024-08-26 21:54:36 +0000 |
| commit | 284b75a3d83c7631586d98f6dede1d90f128f0db (patch) | |
| tree | 2ebf04915b6976c418b592e81f9796d8b9967578 /drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | |
| parent | ata: pata_macio: Use WARN instead of BUG (diff) | |
| download | kernel-284b75a3d83c7631586d98f6dede1d90f128f0db.tar.gz kernel-284b75a3d83c7631586d98f6dede1d90f128f0db.zip | |
ata: libata: Fix memory leak for error path in ata_host_alloc()
In ata_host_alloc(), if devres_alloc() fails to allocate the device host
resource data pointer, the already allocated ata_host structure is not
freed before returning from the function. This results in a potential
memory leak.
Call kfree(host) before jumping to the error handling path to ensure
that the ata_host structure is properly freed if devres_alloc() fails.
Fixes: 2623c7a5f279 ("libata: add refcounting to ata_host")
Cc: [email protected]
Signed-off-by: Zheng Qixing <[email protected]>
Reviewed-by: Yu Kuai <[email protected]>
Signed-off-by: Damien Le Moal <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c')
0 files changed, 0 insertions, 0 deletions
