lkml.org 
[lkml]   [2007]   [Dec]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 05/16] make write() operation smp aware
Date
On Friday 21 December 2007 00:33:45 Glauber de Oliveira Costa wrote:
> --- a/drivers/lguest/lguest_user.c
> +++ b/drivers/lguest/lguest_user.c
> @@ -223,14 +223,21 @@ static ssize_t write(struct file *file, const char
...
> /* If you haven't initialized, you must do that first. */
> - if (req != LHREQ_INITIALIZE && !lg)
> - return -EINVAL;
> + if (req != LHREQ_INITIALIZE) {
> + if (!lg)
> + return -EINVAL;
> + vcpu = &lg->vcpus[vcpu_id];
> + if (!vcpu)
> + return -EINVAL;
> + }

Bounds check again...

Cheers,
Rusty.


\
 
 \ /
  Last update: 2007-12-26 00:43    [W:0.059 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site