This is a note to let you know that I've just added the patch titled

    media: staging: lirc_serial: Free resources on failure paths of 
lirc_serial_probe()

to the 3.2-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     
media-staging-lirc_serial-free-resources-on-failure-paths-of-lirc_serial_probe.patch
and it can be found in the queue-3.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From c8e57e1b766c2321aa76ee5e6878c69bd2313d62 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <[email protected]>
Date: Wed, 16 Nov 2011 01:52:11 -0300
Subject: media: staging: lirc_serial: Free resources on failure paths of 
lirc_serial_probe()

From: Ben Hutchings <[email protected]>

commit c8e57e1b766c2321aa76ee5e6878c69bd2313d62 upstream.

Failure to allocate the I/O region leaves the IRQ allocated.
A later failure leaves them both allocated.

Reported-by: Torsten Crass <[email protected]>
Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Jonathan Nieder <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/staging/media/lirc/lirc_serial.c |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

--- a/drivers/staging/media/lirc/lirc_serial.c
+++ b/drivers/staging/media/lirc/lirc_serial.c
@@ -875,11 +875,14 @@ static int __devinit lirc_serial_probe(s
                       ": or compile the serial port driver as module and\n");
                printk(KERN_WARNING LIRC_DRIVER_NAME
                       ": make sure this module is loaded first\n");
-               return -EBUSY;
+               result = -EBUSY;
+               goto exit_free_irq;
        }
 
-       if (hardware_init_port() < 0)
-               return -EINVAL;
+       if (hardware_init_port() < 0) {
+               result = -EINVAL;
+               goto exit_release_region;
+       }
 
        /* Initialize pulse/space widths */
        init_timing_params(duty_cycle, freq);
@@ -911,6 +914,16 @@ static int __devinit lirc_serial_probe(s
 
        dprintk("Interrupt %d, port %04x obtained\n", irq, io);
        return 0;
+
+exit_release_region:
+       if (iommap != 0)
+               release_mem_region(iommap, 8 << ioshift);
+       else
+               release_region(io, 8);
+exit_free_irq:
+       free_irq(irq, (void *)&hardware);
+
+       return result;
 }
 
 static int __devexit lirc_serial_remove(struct platform_device *dev)


Patches currently in stable-queue which might be from [email protected] are

queue-3.2/media-staging-lirc_serial-do-not-assume-error-codes-returned-by-request_irq.patch
queue-3.2/media-staging-lirc_serial-fix-deadlock-on-resume-failure.patch
queue-3.2/media-staging-lirc_serial-free-resources-on-failure-paths-of-lirc_serial_probe.patch
queue-3.2/media-staging-lirc_serial-fix-init-exit-order.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to