[PATCH 09/11] isdn/gigaset: fix leaks in error path

From: Tilman Schmidt
Date: Mon Jul 05 2010 - 20:19:50 EST


Take care to free all previously allocated ressources in the
"out of memory" error path of the ISDN_CMD_DIAL branch.
Based on an original patch by Dan Carpenter.

Impact: bugfix
Reported-by: Dan Carpenter <error27@xxxxxxxxx>
Signed-off-by: Tilman Schmidt <tilman@xxxxxxx>
Acked-by: Dan Carpenter <error27@xxxxxxxxx>
---
drivers/isdn/gigaset/i4l.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index 1d084bb..34bca37 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -419,6 +419,8 @@ oom:
dev_err(bcs->cs->dev, "out of memory\n");
for (i = 0; i < AT_NUM; ++i)
kfree(commands[i]);
+ kfree(commands);
+ gigaset_free_channel(bcs);
return -ENOMEM;
}

--
1.6.5.3.298.g39add

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/