fix mem-leak in sidewinder driver
PATCH 1/1 fix mem-leak in sidewinder driver
In sw_connect we leak 'buf' and 'idbuf' when we do not leave via one of the fail* labels. This was spotted by the coverity checker. This patch fixes the memory leak.
Patch is compile tested only due to lack of hardware.
Signed-off-by Jesper Juhl <[email protected]>
---
drivers/input/joystick/sidewinder.c | 2 ++ 1 files changed, 2 insertions(+)
drivers/input/joystick/sidewinder.c +2 -0
@@ -776,6 +776,8 @@ static int sw_connect(struct gameport *g goto fail4; } +kfree (buf); +kfree (idbuf);return 0 ; fail4:input_free_device (sw->dev[i]);
Dmitry Torokhov
AppliedQuoted 4 lines · Jesper Juhl
In
sw_connectwe leak 'buf' and 'idbuf' when we do not leave via one of the fail* labels. This was spotted by the coverity checker. This patch fixes the memory leak.
Applied, thank you Jesper.
Signature · 1 line
Dmitry