Commit 9f3f7467 authored by Rusty Russell's avatar Rusty Russell

lguest: remove bogus NULL cpu check

If lg isn't NULL, and cpu_id is sane, &lg->cpus[cpu_id] can't be NULL.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 24adf127
...@@ -251,8 +251,6 @@ static ssize_t write(struct file *file, const char __user *in, ...@@ -251,8 +251,6 @@ static ssize_t write(struct file *file, const char __user *in,
if (!lg || (cpu_id >= lg->nr_cpus)) if (!lg || (cpu_id >= lg->nr_cpus))
return -EINVAL; return -EINVAL;
cpu = &lg->cpus[cpu_id]; cpu = &lg->cpus[cpu_id];
if (!cpu)
return -EINVAL;
/* Once the Guest is dead, you can only read() why it died. */ /* Once the Guest is dead, you can only read() why it died. */
if (lg->dead) if (lg->dead)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment