Commit 54438f9d authored by Tilman Schmidt's avatar Tilman Schmidt Committed by David S. Miller

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarTilman Schmidt <tilman@imap.cc>
Acked-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7d060ed2
...@@ -419,6 +419,8 @@ static int command_from_LL(isdn_ctrl *cntrl) ...@@ -419,6 +419,8 @@ static int command_from_LL(isdn_ctrl *cntrl)
dev_err(bcs->cs->dev, "out of memory\n"); dev_err(bcs->cs->dev, "out of memory\n");
for (i = 0; i < AT_NUM; ++i) for (i = 0; i < AT_NUM; ++i)
kfree(commands[i]); kfree(commands[i]);
kfree(commands);
gigaset_free_channel(bcs);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment