]> git.dujemihanovic.xyz Git - u-boot.git/commit
w1: fix data abort if no one wire bus master present
authorMartin Fuzzey <martin.fuzzey@flowbird.group>
Mon, 22 Oct 2018 16:31:08 +0000 (18:31 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 1 Nov 2018 14:02:10 +0000 (10:02 -0400)
commit65b60897a700e63af02ba46249de60ed3f79ca41
tree12adeaae1bc8f2e486d4ed165dd0ec3c799e657a
parent586d4b010e8ff8894c29c65b68f2afb518a783c8
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>
drivers/w1/w1-uclass.c