mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 12:16:41 +00:00
hwspinlock: add a check of devm_regmap_field_alloc in qcom_hwspinlock_probe
devm_regmap_field_alloc may fails, priv field might be error pointer and cause illegal address access later. Signed-off-by: Kang Chen <void0red@gmail.com> Link: https://lore.kernel.org/r/20230227004116.1273988-1-void0red@gmail.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
parent
06c2afb862
commit
3c81195a04
@ -197,6 +197,8 @@ static int qcom_hwspinlock_probe(struct platform_device *pdev)
|
||||
|
||||
bank->lock[i].priv = devm_regmap_field_alloc(&pdev->dev,
|
||||
regmap, field);
|
||||
if (IS_ERR(bank->lock[i].priv))
|
||||
return PTR_ERR(bank->lock[i].priv);
|
||||
}
|
||||
|
||||
return devm_hwspin_lock_register(&pdev->dev, bank, &qcom_hwspinlock_ops,
|
||||
|
Loading…
Reference in New Issue
Block a user