Fix coverity defects
coverity scan CID:147504 Type: Explicit null dereferenced Reason: passing null pointer dl to zfs_dirent_unlock Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: BearBabyLiu <liu.huang@zte.com.cn> Closes #5131
This commit is contained in:
parent
9911a9c4c9
commit
609603a5d3
|
@ -1470,8 +1470,10 @@ top:
|
||||||
if (S_ISREG(ZTOI(zp)->i_mode) &&
|
if (S_ISREG(ZTOI(zp)->i_mode) &&
|
||||||
(vap->va_mask & ATTR_SIZE) && (vap->va_size == 0)) {
|
(vap->va_mask & ATTR_SIZE) && (vap->va_size == 0)) {
|
||||||
/* we can't hold any locks when calling zfs_freesp() */
|
/* we can't hold any locks when calling zfs_freesp() */
|
||||||
|
if (dl) {
|
||||||
zfs_dirent_unlock(dl);
|
zfs_dirent_unlock(dl);
|
||||||
dl = NULL;
|
dl = NULL;
|
||||||
|
}
|
||||||
error = zfs_freesp(zp, 0, 0, mode, TRUE);
|
error = zfs_freesp(zp, 0, 0, mode, TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue