diff options
-rw-r--r-- | libdiskfs/dir-renamed.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libdiskfs/dir-renamed.c b/libdiskfs/dir-renamed.c index 9b7ec3a6..9e37e234 100644 --- a/libdiskfs/dir-renamed.c +++ b/libdiskfs/dir-renamed.c @@ -209,7 +209,12 @@ diskfs_rename_dir (struct node *fdp, struct node *fnp, const char *fromname, if (tmpnp) diskfs_nrele (tmpnp); if (err) - goto out; + { + assert (!tmpnp); + /* diskfs_lookup has not locked fnp then, do not unlock it. */ + fnp = NULL; + goto out; + } diskfs_dirremove (fdp, fnp, fromname, ds); ds = 0; |