From: Jesper Juhl Fix leak of `rcvmsg' in sc_ioctl(). There are two returns in the switch in sc_ioctl (the SCIOCSTART case) that may leak `rcvmsg'. This patch fixes that by adding a kfree() call at the beginning of that case. Bug found by the coverity checker as #1098 Eric Sesterhenn send me a patch to fix the leak(s) by adding 2 kfree() calls before the returns, I changed that into just a single call at the beginning. Signed-off-by: Jesper Juhl Cc: Karsten Keil Signed-off-by: Andrew Morton --- drivers/isdn/sc/ioctl.c | 1 + 1 files changed, 1 insertion(+) diff -puN drivers/isdn/sc/ioctl.c~i4l-memory-leak-fix-for-sc_ioctl drivers/isdn/sc/ioctl.c --- devel/drivers/isdn/sc/ioctl.c~i4l-memory-leak-fix-for-sc_ioctl 2006-04-20 23:00:09.000000000 -0700 +++ devel-akpm/drivers/isdn/sc/ioctl.c 2006-04-20 23:00:09.000000000 -0700 @@ -97,6 +97,7 @@ int sc_ioctl(int card, scs_ioctl *data) case SCIOCSTART: { + kfree(rcvmsg); pr_debug("%s: SCIOSTART: ioctl received\n", sc_adapter[card]->devicename); if(sc_adapter[card]->EngineUp) { _