goldfish: fix kernel panic when using multiple adb connection
authorJun Tian <jun.j.tian@intel.com>
Mon, 12 May 2014 15:54:57 +0000 (16:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 May 2014 20:19:00 +0000 (13:19 -0700)
When using multiple adb on 64 bit kernel to transfer data,
the goldfish pipe interrupt will crash the kernel.

Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/platform/goldfish/goldfish_pipe.c

index f33c6e0e7fb0ef099751f0d091792771a58c59b0..670b9b94f74bdf6919a5fe06b10c22cc0889180f 100644 (file)
@@ -469,6 +469,9 @@ static irqreturn_t goldfish_pipe_interrupt(int irq, void *dev_id)
 
 #ifdef CONFIG_64BIT
                channel = (u64)readl(dev->base + PIPE_REG_CHANNEL_HIGH) << 32;
+
+               if (channel == 0)
+                       break;
 #endif
                channel |= readl(dev->base + PIPE_REG_CHANNEL);