diff options
author | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-11-09 14:45:58 +1100 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> | 2015-12-17 14:51:46 +1100 |
commit | eea8cf830616dbbd9024b7d704cf0ccf2dac4767 (patch) | |
tree | a2eae11b0af3de7c71d74d7acac9952b485c6f3e /discover/ipmi.c | |
parent | 0dae90626e54e46372c9feddc2f9ac82f046547d (diff) | |
download | talos-petitboot-eea8cf830616dbbd9024b7d704cf0ccf2dac4767.tar.gz talos-petitboot-eea8cf830616dbbd9024b7d704cf0ccf2dac4767.zip |
discover: Properly handle return values
Fixes three unchecked return values, and one missing
initialisation.
Fixes Coverity defects #30450, #30451, #30454, and #30483
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Diffstat (limited to 'discover/ipmi.c')
-rw-r--r-- | discover/ipmi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/discover/ipmi.c b/discover/ipmi.c index 54d4e06..f59974a 100644 --- a/discover/ipmi.c +++ b/discover/ipmi.c @@ -183,7 +183,8 @@ int ipmi_transaction(struct ipmi *ipmi, uint8_t netfn, uint8_t cmd, out: lock.l_type = F_UNLCK; - fcntl(ipmi->fd, F_SETLKW, &lock); + if (fcntl(ipmi->fd, F_SETLKW, &lock) == -1) + pb_log("IPMI: error unlocking IPMI device: %m\n"); return rc ? -1 : 0; } |