mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
misc: k3_avs: Fix possible NULL pointer deference
Its possible that k3_avs_priv is NULL because the driver may not have been probed yet. Therefore check if pointer is valid before dereferencing it. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
This commit is contained in:
parent
548ce227d3
commit
7a8d03f88e
1 changed files with 4 additions and 0 deletions
|
@ -191,6 +191,10 @@ int k3_avs_notify_freq(int dev_id, int clk_id, u32 freq)
|
|||
struct k3_avs_privdata *priv = k3_avs_priv;
|
||||
struct vd_data *vd;
|
||||
|
||||
/* Driver may not be probed yet */
|
||||
if (!priv)
|
||||
return -EINVAL;
|
||||
|
||||
for (vd = priv->vd_config->vds; vd->id >= 0; vd++) {
|
||||
if (vd->dev_id != dev_id || vd->clk_id != clk_id)
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue