Check the 'mtablock' for negative value
authorLaszlo Papp <ext-laszlo.papp@nokia.com>
Mon, 7 Mar 2011 13:40:59 +0000 (15:40 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 30 Mar 2011 17:34:59 +0000 (19:34 +0200)
util/fusermount.c

index c37e57ba3195ae05a06df71de190378ab891ad2d..85292fb28e294d7dd1598e939f32b03d7b8a54ee 100644 (file)
@@ -124,8 +124,10 @@ static int lock_umount(void)
 
 static void unlock_umount(int mtablock)
 {
-       lockf(mtablock, F_ULOCK, 0);
-       close(mtablock);
+       if (mtablock >= 0) {
+               lockf(mtablock, F_ULOCK, 0);
+               close(mtablock);
+       }
 }
 
 static int add_mount(const char *source, const char *mnt, const char *type,