Skip to contentSkip to conversation

xshm: calling unlock improperly in xshmchr_chrpoll()

PATCH In review Dan Carpenter 2 participants 2 messages Dec 8, 2011 – Dec 9, 2011 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xshm: calling unlock improperly in xshmchr_chrpoll()

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

drivers/xshm/xshm_chr.c +2 -1
index 8593367..4df1287 100644
@@ -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;
Acked-by on v1 1/1
#1 lore raw

Hi Dan,

Quoted 2 lines

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

Quoted 1 line

Thank you for spotting this.
I will include this patch when I send out a new patch-set.

Regards,
Sjur
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html