aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorOndrej Zary <[email protected]>2023-03-14 22:58:05 +0000
committerDamien Le Moal <[email protected]>2023-03-16 07:54:38 +0000
commit5bc9e2d43f86105a95f86fa096fb4e517bb0ce73 (patch)
tree8a25dc866ff77aca6003a764d774584111c60748 /fs/proc/array.c
parentata: pata_parport: fix parport release without claim (diff)
downloadkernel-5bc9e2d43f86105a95f86fa096fb4e517bb0ce73.tar.gz
kernel-5bc9e2d43f86105a95f86fa096fb4e517bb0ce73.zip
ata: pata_parport: fix memory leaks
When ida_alloc() fails, "pi" is not freed although the misleading comment says otherwise. Move the ida_alloc() call up so we really don't have to free "pi" in case of ida_alloc() failure. Also move ida_free() call from pi_remove_one() to pata_parport_dev_release(). It was dereferencing already freed dev pointer. Testing revealed leak even in non-failure case which was tracked down to missing put_device() call after bus_find_device_by_name(). As a result, pata_parport_dev_release() was never called. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ Signed-off-by: Ondrej Zary <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
0 files changed, 0 insertions, 0 deletions