staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()
When it failed to allocate for printer_ports, serial_ports can be freed in dgap_tty_uninit(). Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
462310f3f3
commit
0ade4a34fd
@@ -4147,10 +4147,9 @@ static int dgap_tty_register_ports(struct board_t *brd)
|
|||||||
|
|
||||||
brd->printer_ports = kcalloc(brd->nasync, sizeof(*brd->printer_ports),
|
brd->printer_ports = kcalloc(brd->nasync, sizeof(*brd->printer_ports),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (brd->printer_ports == NULL) {
|
if (brd->printer_ports == NULL)
|
||||||
kfree(brd->serial_ports);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
for (i = 0; i < brd->nasync; i++)
|
for (i = 0; i < brd->nasync; i++)
|
||||||
tty_port_init(&brd->printer_ports[i]);
|
tty_port_init(&brd->printer_ports[i]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user