Hi sunjd,

Coverity diagnosed a deadcode path in stonithd_lib.c, and I thought that
might be of interest to you.

At stonithd_lib.c:194 (stonithd_signon()), rc is checked for ST_OK and
the function aborts otherwise. rc is not set to any other value in the
following code. Thus the check in line 248 is never true.

This seems to imply that nothing between :194 and :248 can affect the
signon. (Except, of course, for those two error legs which instead of
using the common error handling code return directly.)

I'd suggest to rearrange the code with a common error handler at the end
of the function, and on error, goto there. That's a pretty standard C
idiom...


Sincerely,
    Lars Marowsky-Brée

-- 
High Availability & Clustering
SUSE Labs, Research and Development
SUSE LINUX Products GmbH - A Novell Business     -- Charles Darwin
"Ignorance more frequently begets confidence than does knowledge"

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to