summaryrefslogtreecommitdiffstats
path: root/lib/loopdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/loopdev.c')
-rw-r--r--lib/loopdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index 2035d2314..0e22bca1c 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -1225,7 +1225,7 @@ int loopdev_is_used(const char *device, const char *filename,
struct stat st;
int rc = 0;
- if (!device)
+ if (!device || !filename)
return 0;
loopcxt_init(&lc, 0);
@@ -1243,6 +1243,9 @@ int loopdev_delete(const char *device)
struct loopdev_cxt lc;
int rc;
+ if (!device)
+ return -EINVAL;
+
loopcxt_init(&lc, 0);
rc = loopcxt_set_device(&lc, device);
if (!rc)