From: Tilman Schmidt Date: Mon, 5 Jul 2010 14:19:19 +0000 (+0000) Subject: isdn/gigaset: fix leaks in error path X-Git-Tag: MMI-PSA29.97-13-9~23092^2~320 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=54438f9dfcc3902a8ee74ceb8ef71316d9ef98a3;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git isdn/gigaset: fix leaks in error path 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 Signed-off-by: Tilman Schmidt Acked-by: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c index 1d084bbb7239..34bca37d65b9 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; }