diff options
| author | Andrew Goodbody <[email protected]> | 2025-08-12 11:13:49 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-08-19 11:26:07 -0600 |
| commit | b90927bd0d81096239ff4a48a71c3d9e87ef7209 (patch) | |
| tree | 431a2755e1467029b4f110b94a6478a6cdf8615f /drivers/soc | |
| parent | cf11b98f139c996bf60c0abe20d343060c4fef26 (diff) | |
soc: ti: k3-navss-ringacc: NULL check before dereference
Move the first dereference of ring to after the NULL check has occurred.
This will prevent any possible dereference of NULL.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <[email protected]>
Diffstat (limited to 'drivers/soc')
| -rw-r--r-- | drivers/soc/ti/k3-navss-ringacc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/soc/ti/k3-navss-ringacc.c b/drivers/soc/ti/k3-navss-ringacc.c index 14114a65830..ac29158d489 100644 --- a/drivers/soc/ti/k3-navss-ringacc.c +++ b/drivers/soc/ti/k3-navss-ringacc.c @@ -632,12 +632,14 @@ err_free_ops: int k3_nav_ringacc_ring_cfg(struct k3_nav_ring *ring, struct k3_nav_ring_cfg *cfg) { - struct k3_nav_ringacc *ringacc = ring->parent; + struct k3_nav_ringacc *ringacc; int ret = 0; if (!ring || !cfg) return -EINVAL; + ringacc = ring->parent; + if (ringacc->dual_ring) return k3_dmaring_ring_cfg(ring, cfg); |
