USB: serial: cyberjack: fix NULL-deref at open
[pandora-kernel.git] / drivers / watchdog / omap_wdt.c
index 2b4acb8..8a93753 100644 (file)
@@ -150,6 +150,13 @@ static int omap_wdt_open(struct inode *inode, struct file *file)
 
        pm_runtime_get_sync(wdev->dev);
 
+       /*
+        * Make sure the watchdog is disabled. This is unfortunately required
+        * because writing to various registers with the watchdog running has no
+        * effect.
+        */
+       omap_wdt_disable(wdev);
+
        /* initialize prescaler */
        while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01)
                cpu_relax();