[PATCH] crypto: rockchip - Drop the runtime PM reference on DMA mapping errors
Herbert Xu
herbert at gondor.apana.org.au
Thu Dec 3 22:05:40 PST 2026
Suyuan Wang via B4 Relay <devnull+shyckless.gmail.com at kernel.org> wrote:
> From: Suyuan Wang <stevewong at hust.edu.cn>
>
> rk_cipher_run() takes a runtime PM reference with
> pm_runtime_resume_and_get() at the start of every request. The normal
> exit path drops it again at the theend label.
>
> If dma_map_sg() fails, the function jumps to theend_sgs or theend_iv
> and returns the error without calling pm_runtime_put_autosuspend().
> Each such request leaves one usage count behind, so the device can no
> longer runtime suspend.
>
> Drop the reference on this error path too.
>
> Found with a static analysis tool and checked by hand.
>
> Fixes: 9dcd71c863a6 ("crypto: rockchip - Add support for RK3399")
> Cc: stable at vger.kernel.org
> Co-developed-by: Kaixuan Li <kaixuan.li at ntu.edu.sg>
> Signed-off-by: Kaixuan Li <kaixuan.li at ntu.edu.sg>
> Signed-off-by: Suyuan Wang <stevewong at hust.edu.cn>
> ---
> Compile tested on arm64 (W=1). I don't have the hardware.
> ---
> drivers/crypto/rockchip/rk3288_crypto_skcipher.c | 1 +
> 1 file changed, 1 insertion(+)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
More information about the linux-arm-kernel
mailing list