driver: rng: Fix SMCCC TRNG crash
Fix a SMCCC TRNG null pointer crash due to a failed smccc feature
binding.
Fixes: 53355bb86c ("drivers: rng: add smccc trng driver")
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
This commit is contained in:
@@ -165,7 +165,7 @@ static int smccc_trng_probe(struct udevice *dev)
|
||||
struct smccc_trng_priv *priv = dev_get_priv(dev);
|
||||
struct arm_smccc_res res;
|
||||
|
||||
if (!(smccc_trng_is_supported(smccc->invoke_fn)))
|
||||
if (!smccc || !(smccc_trng_is_supported(smccc->invoke_fn)))
|
||||
return -ENODEV;
|
||||
|
||||
/* At least one of 64bit and 32bit interfaces is available */
|
||||
|
||||
Reference in New Issue
Block a user