]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: atmel-sha204a - remove sysfs group before hwrng
authorThorsten Blum <thorsten.blum@linux.dev>
Sun, 17 May 2026 12:37:07 +0000 (14:37 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 May 2026 12:25:30 +0000 (20:25 +0800)
atmel_sha204a_probe() registers the hwrng before creating the sysfs
group. Mirror this order in atmel_sha204a_remove() by removing the sysfs
group before unregistering the hwrng.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/atmel-sha204a.c

index 6e6ac4770416eeb5a7d575a8ead67e693be57a0a..37538b0fd7c288c5659371211619983e940f91dd 100644 (file)
@@ -199,11 +199,10 @@ static void atmel_sha204a_remove(struct i2c_client *client)
 {
        struct atmel_i2c_client_priv *i2c_priv = i2c_get_clientdata(client);
 
+       sysfs_remove_group(&client->dev.kobj, &atmel_sha204a_groups);
        devm_hwrng_unregister(&client->dev, &i2c_priv->hwrng);
        atmel_i2c_flush_queue();
 
-       sysfs_remove_group(&client->dev.kobj, &atmel_sha204a_groups);
-
        kfree((void *)i2c_priv->hwrng.priv);
 }