Skip to content
Commit 0211a13b authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Tkkg1994
Browse files

scsi: ufs: ufshcd: fix potential NULL pointer dereference in ufshcd_config_vreg



[ Upstream commit 727535903bea924c4f73abb202c4b3e85fff0ca4 ]

_vreg_ is being dereferenced before it is null checked, hence there is a
potential null pointer dereference.

Fix this by moving the pointer dereference after _vreg_ has been null
checked.

This issue was detected with the help of Coccinelle.

Fixes: aa497613 ("ufs: Add regulator enable support")
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarTkkg1994 <luca@grifodev.ch>
parent ced6d528
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment