Skip to content

Commit

Permalink
ofw: Fix inverted bcmp in ofw_bus_node_status_okay
Browse files Browse the repository at this point in the history
Otherwise this matches any two-character status except for ok.

Fixes:		e5e94d2 ("Expand OpenFirmware API with ofw_bus_node_status_okay method")
MFC after:	1 week
  • Loading branch information
jrtc27 committed Dec 17, 2024
1 parent f25d7ff commit e1060f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/dev/ofw/ofw_bus_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e1060f6

Please sign in to comment.