diff options
| author | Igor Pylypiv <ipylypiv@google.com> | 2024-11-08 00:15:42 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-05 14:01:58 +0100 |
| commit | 5556876be9ec4668a3b8aec500417ba112ec79f1 (patch) | |
| tree | 546e202aa93b45c97154a4d82c4a2917d8142122 /tools/testing | |
| parent | 57860a80f03f9dc69a34a5c37b0941ad032a0a8c (diff) | |
| download | linux-5556876be9ec4668a3b8aec500417ba112ec79f1.tar.gz linux-5556876be9ec4668a3b8aec500417ba112ec79f1.tar.bz2 linux-5556876be9ec4668a3b8aec500417ba112ec79f1.zip | |
i2c: dev: Fix memory leak when underlying adapter does not support I2C
[ Upstream commit 48730a9d04ffccda541602d722d1ff81920a85d8 ]
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: 97ca843f6ad3 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
0 files changed, 0 insertions, 0 deletions
