Skip to contentSkip to conversation

watchdog: ts72xx_wdt: locking bug in ioctl

PATCH In review Dan Carpenter 2 participants 2 messages Aug 23, 2013 – Oct 1, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 watchdog: ts72xx_wdt: locking bug in ioctl

Calling the WDIOC_GETSTATUS & WDIOC_GETBOOTSTATUS and twice will cause a interruptible deadlock.

drivers/watchdog/ts72xx_wdt.c +2 -1
index 9125b0f..3ddd527 100644
@@ -311,7 +311,8 @@ static long ts72xx_wdt_ioctl(struct file *file, unsigned int cmd,
 
 	case WDIOC_GETSTATUS:
 	case WDIOC_GETBOOTSTATUS:
-		return put_user(0, p);
+		error = put_user(0, p);
+		break;
 
 	case WDIOC_KEEPALIVE:
 		ts72xx_wdt_kick(wdt);