aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2014-10-01 19:27:09 -0400
committerDave Chinner <david@fromorbit.com>2014-10-01 19:27:09 -0400
commit5cca3f611d159e5a4a5ec60413bd09948ef40aea (patch)
tree393d1019eb362fc023addf6144972de83fb06dda /fs/xfs/xfs_iomap.c
parent04dd1a0d4b17a71220eae4fb313218f15a49bcdd (diff)
xfs: check for null dquot in xfs_quota_calc_throttle()
Coverity spotted this. Granted, we *just* checked xfs_inod_dquot() in the caller (by calling xfs_quota_need_throttle). However, this is the only place we don't check the return value but the check is cheap and future-proof so add it. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index e9c47b6f5e5a..afcf3c926565 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -404,8 +404,8 @@ xfs_quota_calc_throttle(
404 int shift = 0; 404 int shift = 0;
405 struct xfs_dquot *dq = xfs_inode_dquot(ip, type); 405 struct xfs_dquot *dq = xfs_inode_dquot(ip, type);
406 406
407 /* over hi wmark, squash the prealloc completely */ 407 /* no dq, or over hi wmark, squash the prealloc completely */
408 if (dq->q_res_bcount >= dq->q_prealloc_hi_wmark) { 408 if (!dq || dq->q_res_bcount >= dq->q_prealloc_hi_wmark) {
409 *qblocks = 0; 409 *qblocks = 0;
410 *qfreesp = 0; 410 *qfreesp = 0;
411 return; 411 return;