media: staging: lirc_serial: Fix deadlock on resume failure
authorBen Hutchings <ben@decadent.org.uk>
Wed, 16 Nov 2011 04:53:25 +0000 (01:53 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Mar 2012 19:31:39 +0000 (12:31 -0700)
commit 1ff1d88e862948ae5bfe490248c023ff8ac2855d upstream.

A resume function cannot remove the device it is resuming!

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/lirc/lirc_serial.c

index d833772..befe626 100644 (file)
@@ -1127,10 +1127,8 @@ static int lirc_serial_resume(struct platform_device *dev)
 {
        unsigned long flags;
 
 {
        unsigned long flags;
 
-       if (hardware_init_port() < 0) {
-               lirc_serial_exit();
+       if (hardware_init_port() < 0)
                return -EINVAL;
                return -EINVAL;
-       }
 
        spin_lock_irqsave(&hardware[type].lock, flags);
        /* Enable Interrupt */
 
        spin_lock_irqsave(&hardware[type].lock, flags);
        /* Enable Interrupt */