diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-07-31 19:54:55 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-08-11 14:19:27 +0300 |
commit | 3feec4ef9f99e2ca3c4614bc0c46e9c0ad337357 (patch) | |
tree | dec650989b46ed697ea51a29ef7530d578b5b178 /drivers/crypto/stm32/stm32-hash.c | |
parent | aec48805163338f8413118796c1dd035661b9140 (diff) | |
download | linux-3feec4ef9f99e2ca3c4614bc0c46e9c0ad337357.tar.xz |
crypto: stm32 - Drop if block with always false condition
stm32_hash_remove() is only called after stm32_hash_probe() succeeded. In
this case platform_set_drvdata() was called with a non-NULL data patameter.
The check for hdev being non-NULL can be dropped because hdev is never NULL
(or something bad like memory corruption happened and then the check
doesn't help any more either).
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/stm32/stm32-hash.c')
-rw-r--r-- | drivers/crypto/stm32/stm32-hash.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index 75d281edae2a..b10243035584 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -2114,13 +2114,9 @@ err_reset: static int stm32_hash_remove(struct platform_device *pdev) { - struct stm32_hash_dev *hdev; + struct stm32_hash_dev *hdev = platform_get_drvdata(pdev); int ret; - hdev = platform_get_drvdata(pdev); - if (!hdev) - return -ENODEV; - ret = pm_runtime_get_sync(hdev->dev); stm32_hash_unregister_algs(hdev); |