[IA64] ioc3_serial: release resources in error return path
authorRahul Ruikar <rahul.ruikar@gmail.com>
Fri, 1 Oct 2010 20:32:45 +0000 (13:32 -0700)
committerTony Luck <tony.luck@intel.com>
Fri, 1 Oct 2010 20:32:45 +0000 (13:32 -0700)
In ioc3uart_probe()
resources were not released during error return path
- ports[phys_port]

Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
drivers/serial/ioc3_serial.c

index 93de907b12088a54ab5809cf79c46ba5ec2757f2..08d77b041bd8599923ef3240f6221d0551dc5179 100644 (file)
@@ -2017,6 +2017,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd)
        struct ioc3_port *port;
        struct ioc3_port *ports[PORTS_PER_CARD];
        int phys_port;
+       int cnt;
 
        DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __func__, is, idd));
 
@@ -2146,6 +2147,9 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd)
 
        /* error exits that give back resources */
 out4:
+       for (cnt = 0; cnt < phys_port; cnt++)
+               kfree(ports[cnt]);
+
        kfree(card_ptr);
        return ret;
 }