Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 10 2008 14:25, Nikanth Karthikesan wrote:
>-static int pt_ioctl(struct inode *inode, struct file *file,
>-	 unsigned int cmd, unsigned long arg)
>+static long pt_ioctl(struct file *file, unsigned int cmd,
>+		unsigned long arg)
> {
> 	struct pt_unit *tape = file->private_data;
> 	struct mtop __user *p = (void __user *)arg;
> 	struct mtop mtop;
>+	long err = 0;
>+
>+	lock_kernel();
> 
> 	switch (cmd) {
> 	case MTIOCTOP:
>-		if (copy_from_user(&mtop, p, sizeof(struct mtop)))
>-			return -EFAULT;
>+		if (copy_from_user(&mtop, p, sizeof(struct mtop))) {
>+			err = -EFAULT;
>+			break;
>+		}

I wonder why a simple copy_from_user() requires the BKL.. if pt
does need locking, then probably some mutex inside pt.

-
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux