summaryrefslogtreecommitdiffstats
path: root/rust/alloc/vec/partial_eq.rs
diff options
context:
space:
mode:
authorZheng Qixing <zhengqixing@huawei.com>2024-08-22 11:30:50 +0800
committerDamien Le Moal <dlemoal@kernel.org>2024-08-27 06:54:36 +0900
commit284b75a3d83c7631586d98f6dede1d90f128f0db (patch)
tree2ebf04915b6976c418b592e81f9796d8b9967578 /rust/alloc/vec/partial_eq.rs
parentd4bc0a264fb482b019c84fbc7202dd3cab059087 (diff)
downloadlinux-284b75a3d83c7631586d98f6dede1d90f128f0db.tar.gz
linux-284b75a3d83c7631586d98f6dede1d90f128f0db.tar.bz2
linux-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: stable@vger.kernel.org Signed-off-by: Zheng Qixing <zhengqixing@huawei.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Diffstat (limited to 'rust/alloc/vec/partial_eq.rs')
0 files changed, 0 insertions, 0 deletions