Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53c045c6 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman
Browse files

i2c: i2c-boardinfo: fix memory leaks on devinfo




[ Upstream commit 66a7c84d677e8e4a5a2ef4afdb9bd52e1399a866 ]

Currently when an error occurs devinfo is still allocated but is
unused when the error exit paths break out of the for-loop. Fix
this by kfree'ing devinfo to avoid the leak.

Detected by CoverityScan, CID#1416590 ("Resource Leak")

Fixes: 4124c4eb ("i2c: allow attaching IRQ resources to i2c_board_info")
Fixes: 0daaf99d ("i2c: copy device properties when using i2c_register_board_info()")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 30ac846d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment