Signed-off-by: Jonathan Corbet <corbet@lwn.net>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/compat.h>
+#include <linux/smp_lock.h>
struct ipmi_file_private
{
if (!priv)
return -ENOMEM;
+ lock_kernel();
priv->file = file;
rv = ipmi_create_user(if_num,
&(priv->user));
if (rv) {
kfree(priv);
- return rv;
+ goto out;
}
file->private_data = priv;
priv->default_retries = -1;
priv->default_retry_time_ms = 0;
- return 0;
+out:
+ unlock_kernel();
+ return rv;
}
static int ipmi_release(struct inode *inode, struct file *file)