git: e1060f6dfd80 - main - ofw: Fix inverted bcmp in ofw_bus_node_status_okay

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Tue, 17 Dec 2024 20:54:41 UTC
The branch main has been updated by jrtc27:

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

commit e1060f6dfd80b34cab6d439bf7420ad686ddc8f1
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2024-12-17 20:51:56 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2024-12-17 20:51:56 +0000

    ofw: Fix inverted bcmp in ofw_bus_node_status_okay
    
    Otherwise this matches any two-character status except for ok.
    
    Fixes:          e5e94d2de987 ("Expand OpenFirmware API with ofw_bus_node_status_okay method")
    MFC after:      1 week
---
 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 a6d562cd8e9d..4d0479dfb957 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -210,7 +210,7 @@ ofw_bus_node_status_okay(phandle_t node)
 
 	OF_getprop(node, "status", status, OFW_STATUS_LEN);
 	if ((len == 5 && (bcmp(status, "okay", len) == 0)) ||
-	    (len == 3 && (bcmp(status, "ok", len))))
+	    (len == 3 && (bcmp(status, "ok", len) == 0)))
 		return (1);
 
 	return (0);