Thread (5 messages) flat view 5 messages, 3 authors, 2007-08-10

Re: [PATCH 1/2] pseries: device node status can be "ok" or "okay"

From: Segher Boessenkool <hidden>
Date: 2007-08-10 20:17:23

quoted
quoted
It seems that some versions of firmware will report a device
node status as the string "okay". As we are not expecting this
string, the device node will be ignored by the EEH subsystem.
Which means EEH will not be enabled.

When EEH is not enabled, PCI errors will be converted into
Machine Check exceptions, and we'll have a very unhappy system.
-	if (status && strcmp(status, "ok") != 0)
+	if (status && strncmp(status, "ok", 2) != 0)
 		return NULL;	/* ignore devices with bad status */
Shouldn't you check for the two literal strings, instead of
only matching the common prefix?  Seems safer.
What are the chances that the status string is "oklahoma" or
"okeechobee" or "okinawa"?
What does it matter what the chances are?  The code is either
correct or not ;-)

Besides, that's only part of the problem -- what if the
property is empty, or contains an empty string only, or
a single non-zero byte?


Segher
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help