Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2022 10:06:14 GMT
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 57dd17dd60e7 - stable/13 - Fix error value returned by ofw_bus_gen_get_node().
Message-ID:  <202201201006.20KA6EQY090866@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mmel:

URL: https://cgit.FreeBSD.org/src/commit/?id=57dd17dd60e7bb618ab2979df2d580559fcf3729

commit 57dd17dd60e7bb618ab2979df2d580559fcf3729
Author:     Michal Meloun <mmel@FreeBSD.org>
AuthorDate: 2021-06-24 09:56:20 +0000
Commit:     Michal Meloun <mmel@FreeBSD.org>
CommitDate: 2022-01-20 10:00:55 +0000

    Fix error value returned by ofw_bus_gen_get_node().
    
    By definition ofw_bus_get_node() should  consistently return -1 when there
    is no associated OF node.
    
    MFC after:      4 weeks
    Discussed with: nwhitehorn
    Analyzed in:    https://reviews.freebsd.org/D30761
    
    (cherry picked from commit 3eae4e106ac7222364fc9dc8c3d35d4ad8c5293a)
---
 sys/dev/ofw/ofw_bus_subr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c
index 5ce8d7b7bd48..a630e4333fd9 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -147,7 +147,7 @@ ofw_bus_gen_get_node(device_t bus, device_t dev)
 
 	obd = OFW_BUS_GET_DEVINFO(bus, dev);
 	if (obd == NULL)
-		return (0);
+		return ((phandle_t)-1);
 	return (obd->obd_node);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202201201006.20KA6EQY090866>