9pfs: fix bogus fd check in local_remove()

This was spotted by Coverity as a fd leak. This is certainly true, but also
local_remove() would always return without doing anything, unless the fd is
zero, which is very unlikely.

(Coverity issue CID1371732)

Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Greg Kurz 2017-03-06 17:34:01 +01:00
parent 56b51708e9
commit b7361d46e7
1 changed files with 1 additions and 1 deletions

View File

@ -1008,7 +1008,7 @@ static int local_remove(FsContext *ctx, const char *path)
int err = -1;
dirfd = local_opendir_nofollow(ctx, dirpath);
if (dirfd) {
if (dirfd == -1) {
goto out;
}