Commit 0835b5ee authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull pstore update from Kees Cook:

 - Revert pmsg_lock back to a normal mutex (John Stultz)

* tag 'pstore-v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  pstore: Revert pmsg_lock back to a normal mutex
parents 900941be 5239a89b
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -7,10 +7,9 @@
#include <linux/device.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <linux/uaccess.h>
#include <linux/rtmutex.h>
#include "internal.h"
#include "internal.h"


static DEFINE_RT_MUTEX(pmsg_lock);
static DEFINE_MUTEX(pmsg_lock);


static ssize_t write_pmsg(struct file *file, const char __user *buf,
static ssize_t write_pmsg(struct file *file, const char __user *buf,
			  size_t count, loff_t *ppos)
			  size_t count, loff_t *ppos)
@@ -29,9 +28,9 @@ static ssize_t write_pmsg(struct file *file, const char __user *buf,
	if (!access_ok(buf, count))
	if (!access_ok(buf, count))
		return -EFAULT;
		return -EFAULT;


	rt_mutex_lock(&pmsg_lock);
	mutex_lock(&pmsg_lock);
	ret = psinfo->write_user(&record, buf);
	ret = psinfo->write_user(&record, buf);
	rt_mutex_unlock(&pmsg_lock);
	mutex_unlock(&pmsg_lock);
	return ret ? ret : count;
	return ret ? ret : count;
}
}