phone_open() looks OK, but I don't trust the subsidiary drivers (and ixj in
particular).
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
#include <linux/errno.h>
#include <linux/phonedev.h>
#include <linux/init.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/system.h>
if (minor >= PHONE_NUM_DEVICES)
return -ENODEV;
+ lock_kernel();
mutex_lock(&phone_lock);
p = phone_device[minor];
if (p)
fops_put(old_fops);
end:
mutex_unlock(&phone_lock);
+ unlock_kernel();
return err;
}