commit | 775e7adf5bad5fdd13b295f63bd37c3d0ab1f414 | [log] [tgz] |
---|---|---|
author | Martin Fuzzey <martin.fuzzey@flowbird.group> | Mon Oct 22 18:31:08 2018 +0200 |
committer | Tom Rini <trini@konsulko.com> | Thu Nov 01 10:02:10 2018 -0400 |
tree | 12adeaae1bc8f2e486d4ed165dd0ec3c799e657a | |
parent | 198bd98758b7c1a9d7b78a552ea2c763975ed047 [diff] |
w1: fix data abort if no one wire bus master present When the "w1 bus" command is used with no bus master present a data abort may occur. This is because uclass_first_device() returns zero, but sets the output struct udevice pointer to NULL in the no device found case. Fix w1_get_bus() to account for this and return an error code as is expected by the callers. Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group> Reviewed-by: Eugen Hristev <eugen.hristev@microchip.com>