Skip to content

Commit

Permalink
serial: avoid double free after call ioc4_serial_remove_one
Browse files Browse the repository at this point in the history
  before goto out5,  soft, control, serial are all assigned to idd
  after finish call ioc4_serial_remove_one, all resources are released
  we need return instead of go on, or double free

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Chen Gang authored and Greg Kroah-Hartman committed Jan 16, 2013
1 parent f96f7f7 commit 6d8df4b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/tty/serial/ioc4_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -2883,6 +2883,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
/* error exits that give back resources */
out5:
ioc4_serial_remove_one(idd);
return ret;
out4:
kfree(soft);
out3:
Expand Down

0 comments on commit 6d8df4b

Please sign in to comment.