Files
linux/drivers/i2c/i2c-dev.c
Igor Pylypiv 48730a9d04 i2c: dev: Fix memory leak when underlying adapter does not support I2C
Early return in i2cdev_ioctl_rdwr() failed to free the memory allocated
by the caller. Move freeing the memory to the function where it has been
allocated to prevent similar leaks in the future.

Fixes: 97ca843f6a ("i2c: dev: Check for I2C_FUNC_I2C before calling i2c_transfer")
Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
[wsa: replaced '== NULL' with '!']
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2024-11-14 11:22:57 +01:00

20 KiB