Skip to contentSkip to conversation

fix mem-leak in sidewinder driver

PATCH Applied Jesper Juhl 2 participants 2 messages May 7, 2006 – May 30, 2006 Input drivers

lore
Share & tools
lore
#0 lore raw

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.

---

 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]);
#1 lore raw
Quoted 4 lines · Jesper Juhl

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.

Applied, thank you Jesper.

Signature · 1 line
Dmitry