]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: img-hash - Fix variable dereferenced before check 'hdev->req'
authorGaosheng Cui <cuigaosheng1@huawei.com>
Thu, 1 Dec 2022 06:25:26 +0000 (14:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:23 +0000 (13:26 +0100)
commit52fa7fc3ae3c746e6a4b7c530d804aa5b33c2c15
tree3d189fcd6cae0f5caa21ac5cbd4f81a9d8321854
parent64e23fe3fdeb81d6a06108f30310d752430b6d91
crypto: img-hash - Fix variable dereferenced before check 'hdev->req'

[ Upstream commit 04ba54e5af8f8f0137b08cb51a0b3a2e1ea46c94 ]

Smatch report warning as follows:

drivers/crypto/img-hash.c:366 img_hash_dma_task() warn: variable
dereferenced before check 'hdev->req'

Variable dereferenced should be done after check 'hdev->req',
fix it.

Fixes: d358f1abbf71 ("crypto: img-hash - Add Imagination Technologies hw hash accelerator")
Fixes: 10badea259fa ("crypto: img-hash - Fix null pointer exception")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/img-hash.c