Revert "staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()"
PATCH 1/1 Revert "staging: dgap: remove unneeded kfree() in dgap_tty_register_ports()"
This reverts commit 0ade4a34fd439d62df46937e8f3e584eb0879579.
This patch removes kfree for serial_ports in dgap_tty_register_ports() if the "brd->printer_ports" allocation fails and serial_ports may be freed by calling dgap_tty_uninit() within other patch.
That patch has an error handling but incomplete cleanup
so it need to call kfree() for brd->serial_ports in dgap_tty_register_ports().
Conflicts:
drivers/staging/dgap/dgap.c
--- drivers/staging/dgap/dgap.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/staging/dgap/dgap.c +3 -1
@@ -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 ==NULL ) { +kfree (brd->serial_ports);return -ENOMEM ; + }for (i =0 ; i < brd->nasync; i++) {tty_port_init (&brd->serial_ports[i]);
Signature · 1 line
1.7.1
Greg KH
maintainerQuoted 9 lines · Daeseok Youn
This reverts commit
0ade4a34fd439d62df46937e8f3e584eb0879579.This patch removes kfree for
serial_portsindgap_tty_register_ports()if the "brd->printer_ports" allocation fails andserial_portsmay be freed by callingdgap_tty_uninit()within other patch.
That patch has an error handling but incomplete cleanup
so it need to callkfree()forbrd->serial_portsindgap_tty_register_ports().
Quoted 6 lines
Conflicts:
drivers/staging/dgap/dgap.c--- drivers/staging/dgap/dgap.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
-ENOSIGNEDOFFBY :(