Messages in this thread | | | Date | Sat, 2 Aug 2003 12:46:47 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH] [1/2] random: SMP locking |
| |
Matt Mackall <mpm@selenic.com> wrote: > > + spin_lock(&random_state->lock); > + ent_count = random_state->entropy_count; > + memcpy(tmp, random_state->pool, size * sizeof(__u32)); > + spin_unlock(&random_state->lock); > +
This needs to be spin_lock_irqsave().
> + if (!copy_to_user(p, tmp, size * sizeof(__u32))) { > + kfree(tmp); > + goto fail; > + } > + > + kfree(tmp); > + > + if(put_user(ent_count, p++)) > + goto fail; > + > return 0; > + fail: > + spin_unlock(&random_state->lock);
Double unlock ;) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |