Fix a SMCCC TRNG null pointer crash due to a failed smccc feature
binding.
Fixes: 53355bb86c25 ("drivers: rng: add smccc trng driver")
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
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 */