hwrng: don't init list element we're about to add to list.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 8 Dec 2014 08:50:40 +0000 (16:50 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 22 Dec 2014 12:02:41 +0000 (23:02 +1100)
Another interesting anti-pattern.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/core.c

index e384ee3ed604d8733554db35f870a3239699e7ab..6ec42252e46eb9becd2f278ec5f760650714ef78 100644 (file)
@@ -485,7 +485,6 @@ int hwrng_register(struct hwrng *rng)
                        goto out_unlock;
                }
        }
-       INIT_LIST_HEAD(&rng->list);
        list_add_tail(&rng->list, &rng_list);
 
        if (old_rng && !rng->init) {