提交 aec46bbd 编写于 作者: G Greg Kroah-Hartman

Revert "staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()"

This reverts commit 0ade4a34 as it was
wrong.

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 e00b8fdc
......@@ -4145,8 +4145,10 @@ static int dgap_tty_register_ports(struct board_t *brd)
brd->printer_ports = kcalloc(brd->nasync, sizeof(*brd->printer_ports),
GFP_KERNEL);
if (!brd->printer_ports)
if (!brd->printer_ports) {
kfree(brd->serial_ports);
return -ENOMEM;
}
for (i = 0; i < brd->nasync; i++) {
tty_port_init(&brd->serial_ports[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册