diff options
author | Chen Gang <gang.chen@asianux.com> | 2012-12-26 05:06:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-16 00:54:41 -0500 |
commit | 6d8df4b6a3a46b62b1a6f6e8678ebd3acc6df8c8 (patch) | |
tree | a0cd4ee63124659bd3e2577b8415ed57002bda4d /drivers/tty | |
parent | f96f7f7f39af53274d98aa9c29d6fa4d122218a4 (diff) |
serial: avoid double free after call ioc4_serial_remove_one
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>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/ioc4_serial.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c index 3e7da10cebba..c4e30b841f94 100644 --- a/drivers/tty/serial/ioc4_serial.c +++ b/drivers/tty/serial/ioc4_serial.c | |||
@@ -2883,6 +2883,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd) | |||
2883 | /* error exits that give back resources */ | 2883 | /* error exits that give back resources */ |
2884 | out5: | 2884 | out5: |
2885 | ioc4_serial_remove_one(idd); | 2885 | ioc4_serial_remove_one(idd); |
2886 | return ret; | ||
2886 | out4: | 2887 | out4: |
2887 | kfree(soft); | 2888 | kfree(soft); |
2888 | out3: | 2889 | out3: |