Skip to contentSkip to conversation

snsc: restore IRQs on error path in scdrv_write()

PATCH New Dan Carpenter 1 participant 1 message Nov 18, 2016

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

PATCH 1/1 snsc: restore IRQs on error path in scdrv_write()

This bug is as old as git. We need to be calling spin_unlock_irqrestore() instead of regular spin_unlock() here.

drivers/char/snsc.c +1 -1
index 10e5632..ec07f0e 100644
@@ -285,7 +285,7 @@ scdrv_write(struct file *file, const char __user *buf,
 		DECLARE_WAITQUEUE(wait, current);
 
 		if (file->f_flags & O_NONBLOCK) {
-			spin_unlock(&sd->sd_wlock);
+			spin_unlock_irqrestore(&sd->sd_wlock, flags);
 			up(&sd->sd_wbs);
 			return -EAGAIN;
 		}