serial: avoid double free after call ioc4_serial_remove_one
authorChen Gang <gang.chen@asianux.com>
Wed, 26 Dec 2012 10:06:39 +0000 (18:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jan 2013 05:54:41 +0000 (21:54 -0800)
  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>
drivers/tty/serial/ioc4_serial.c

index 3e7da10cebba3525c43f5f63e383e4bca61deeee..c4e30b841f9439540fba03f0f9f3e8ebb611a2fd 100644 (file)
@@ -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: