Skip to content
Commit 9dc775aa authored by Sean Anderson's avatar Sean Anderson Committed by Tom Rini
Browse files

IOMUX: Fix access past end of console_devices



We should only access console_devices[file][i] once we have checked that i
< cd_count[file]. Otherwise, we will access uninitialized memory at the end
of the loop. console_devices[file][i] should not be NULL, but putting the
assignment in the loop condition allows us to ensure that i is checked
beforehand. This isn't a bug, but it does make valgrind stop complaining.

Fixes: 400797ca ("IOMUX: Split out for_each_console_dev() helper macro")
Signed-off-by: default avatarSean Anderson <seanga2@gmail.com>
Reviewed-by: default avatarAndrew Scull <ascull@google.com>
Acked-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
parent 24c904f3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment