diff options
author | BearBabyLiu <[email protected]> | 2016-09-21 10:09:22 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-09-20 19:09:22 -0700 |
commit | 609603a5d3356c2c69c926038eee6755e0183d27 (patch) | |
tree | cd67d4a103194151e15e9939070aa97e72842a77 /module/zfs | |
parent | 9911a9c4c9501112dcb2a64a5195820068676e62 (diff) |
Fix coverity defects
coverity scan CID:147504 Type: Explicit null dereferenced
Reason: passing null pointer dl to zfs_dirent_unlock
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: BearBabyLiu <[email protected]>
Closes #5131
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/zfs_vnops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 405b37c19..796cd1e34 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -1470,8 +1470,10 @@ top: if (S_ISREG(ZTOI(zp)->i_mode) && (vap->va_mask & ATTR_SIZE) && (vap->va_size == 0)) { /* we can't hold any locks when calling zfs_freesp() */ - zfs_dirent_unlock(dl); - dl = NULL; + if (dl) { + zfs_dirent_unlock(dl); + dl = NULL; + } error = zfs_freesp(zp, 0, 0, mode, TRUE); } } |