All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Randolf Pohl" <randolf.pohl@gmx.de>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lcd: Push the BKL down into the driver ioctl handler
Date: Fri, 23 May 2008 11:06:16 +0200	[thread overview]
Message-ID: <20080523090616.68380@gmx.net> (raw)


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

             reply	other threads:[~2008-05-23  9:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23  9:06 Randolf Pohl [this message]
2008-05-23 10:41 ` [PATCH] lcd: Push the BKL down into the driver ioctl handler Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2008-05-22 22:00 Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080523090616.68380@gmx.net \
    --to=randolf.pohl@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.