summaryrefslogtreecommitdiffstats
path: root/discover/device-handler.c
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-11-09 14:45:58 +1100
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>2015-12-17 14:51:46 +1100
commiteea8cf830616dbbd9024b7d704cf0ccf2dac4767 (patch)
treea2eae11b0af3de7c71d74d7acac9952b485c6f3e /discover/device-handler.c
parent0dae90626e54e46372c9feddc2f9ac82f046547d (diff)
downloadtalos-petitboot-eea8cf830616dbbd9024b7d704cf0ccf2dac4767.zip
talos-petitboot-eea8cf830616dbbd9024b7d704cf0ccf2dac4767.tar.gz
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/device-handler.c')
-rw-r--r--discover/device-handler.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index bfe5fff..3804b34 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -1472,7 +1472,6 @@ mount_ro:
void device_release_write(struct discover_device *dev, bool release)
{
const char *fstype, *device_path;
- int rc = 0;
if (!release)
return;
@@ -1495,10 +1494,9 @@ void device_release_write(struct discover_device *dev, bool release)
device_path = get_device_path(dev);
}
- mount(device_path, dev->mount_path, fstype,
+ if (mount(device_path, dev->mount_path, fstype,
MS_RDONLY | MS_SILENT,
- fs_parameters(dev, MS_RDONLY));
- if (rc)
+ fs_parameters(dev, MS_RDONLY)))
pb_log("Failed to remount %s read-only: %s\n",
device_path, strerror(errno));
else
OpenPOWER on IntegriCloud