Skip to content
Commit 31c8025f authored by David Brazdil's avatar David Brazdil Committed by Rob Herring
Browse files

of: restricted dma: Fix condition for rmem init

of_dma_set_restricted_buffer fails to handle negative return values from
of_property_count_elems_of_size, e.g. when the property does not exist.
This results in an attempt to assign a non-existent reserved memory
region to the device and a warning being printed. Fix the condition to
take negative values into account.

Fixes: f3cfd136

 ("of: restricted dma: Don't fail device probe on rmem init failure")
Cc: Will Deacon <will@kernel.org>
Signed-off-by: default avatarDavid Brazdil <dbrazdil@google.com>
Acked-by: default avatarWill Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210917131423.2760155-1-dbrazdil@google.com


Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent c8087adc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment