From: Chen Gang Date: Wed, 26 Dec 2012 10:06:39 +0000 (+0800) Subject: serial: avoid double free after call ioc4_serial_remove_one X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6d8df4b6a3a46b62b1a6f6e8678ebd3acc6df8c8;p=linux-beck.git 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 Signed-off-by: Greg Kroah-Hartman --- 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) /* error exits that give back resources */ out5: ioc4_serial_remove_one(idd); + return ret; out4: kfree(soft); out3: