mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 13:51:44 +00:00
Revert "staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()"
This reverts commit 0ade4a34fd
as it was
wrong.
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
e00b8fdca8
commit
aec46bbdea
@ -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]);
|
||||
|
Loading…
Reference in New Issue
Block a user