[patch -next] xshm: calling unlock improperly in xshmchr_chrpoll()

From: Dan Carpenter
Date: Thu Dec 08 2011 - 14:24:23 EST


We got interrupted before we could take the lock here, and so we
shouldn't call unlock.

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/xshm/xshm_chr.c b/drivers/xshm/xshm_chr.c
index 8593367..4df1287 100644
--- a/drivers/xshm/xshm_chr.c
+++ b/drivers/xshm/xshm_chr.c
@@ -620,7 +620,7 @@ static unsigned int xshmchr_chrpoll(struct file *filp, poll_table *waittab)
if (mutex_lock_interruptible(&dev->mutex)) {
xdev_dbg(dev, "mutex_lock_interruptible got signalled\n");
mask |= POLLERR;
- goto out;
+ goto out_unlocked;
}
xshmchr_get(dev);

@@ -644,6 +644,7 @@ static unsigned int xshmchr_chrpoll(struct file *filp, poll_table *waittab)

out:
mutex_unlock(&dev->mutex);
+out_unlocked:
xdev_devl(dev, "poll return mask=0x%04x\n", mask);
xshmchr_put(dev);
return mask;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/