X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Flguest%2Flguest_user.c;h=e73a000473cc524cd16d9773da390047d362751e;hb=0a328ea43da9c3eefce7cb6c947e43e1a0fef810;hp=645e6e040bfbeab46bad83b52f9bdf42a310d788;hpb=14d0647c98f52e2d76113d44de6b771ec87a934f;p=pandora-kernel.git diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c index 645e6e040bfb..e73a000473cc 100644 --- a/drivers/lguest/lguest_user.c +++ b/drivers/lguest/lguest_user.c @@ -102,7 +102,7 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o) static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip) { /* We have a limited number the number of CPUs in the lguest struct. */ - if (id >= NR_CPUS) + if (id >= ARRAY_SIZE(cpu->lg->cpus)) return -EINVAL; /* Set up this CPU's id, and pointer back to the lguest struct. */ @@ -251,8 +251,6 @@ static ssize_t write(struct file *file, const char __user *in, if (!lg || (cpu_id >= lg->nr_cpus)) return -EINVAL; cpu = &lg->cpus[cpu_id]; - if (!cpu) - return -EINVAL; /* Once the Guest is dead, you can only read() why it died. */ if (lg->dead)