On Thu, May 07, 2026 at 08:57:16PM -0500, Ethan Tidmore wrote: > The function tegra114_emc_find_timing() has the possibility of returning > null and it's return value 'timing' is dereferenced before it is > checked for null. > > Place dereference after null pointer check. > > Detected by Smatch: > drivers/memory/tegra/tegra114-emc.c:520 tegra114_emc_prepare_timing_change() > warn: variable dereferenced before check 'timing' (see line 515) > > Fixes: dce208b5405f4 ("memory: tegra: Add Tegra114 EMC driver") > Signed-off-by: Ethan Tidmore > --- > drivers/memory/tegra/tegra114-emc.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) It's a *very* theoretically possible NULL pointer dereference. Both the clock and EMC drivers read the timing information from exactly the same device tree nodes, so their timings should always match. If they don't something *really* bad is going on and it might be safer to just crash. On the other hand, if this silences a smatch warning people are just going to keep sending patches and we might as well just "fix" it now, so: Acked-by: Thierry Reding