lkml.org 
[lkml]   [2008]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lcd: Push the BKL down into the driver ioctl handler

unlock_kernel() before return:

> Signed-off-by: Alan Cox <alan@redhat.com>
>
> diff --git a/drivers/char/lcd.c b/drivers/char/lcd.c
> index 4fe9206..1690cfb 100644
> --- a/drivers/char/lcd.c
> +++ b/drivers/char/lcd.c

[...]

> @@ -399,17 +408,15 @@ static int lcd_ioctl(struct inode *inode, struct file *file,
> if (__copy_to_user
> ((struct lcd_display *) arg, &button_display,
> sizeof(struct lcd_display)))
> - return -EFAULT;
> + ret = -EFAULT;
> break;
> }
>
> default:
> - return -EINVAL;
> -
> + ret = -ENOTTY;
> }
> -
> - return 0;
> -
> + lock_kernel();

Shouldn't this be unlock_kernel();

> + return ret;
> }
>
> static int lcd_open(struct inode *inode, struct file *file)
> @@ -462,7 +469,7 @@ static ssize_t lcd_read(struct file *file, char *buf,
>
> static const struct file_operations lcd_fops = {
> .read = lcd_read,
> - .ioctl = lcd_ioctl,
> + .unlocked_ioctl = lcd_ioctl,
> .open = lcd_open,
> };


Cheers,

R.
--
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx


\
 
 \ /
  Last update: 2008-05-23 11:09    [W:1.279 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site