aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log.c
diff options
context:
space:
mode:
authorGeyslan G. Bem <geyslan@gmail.com>2013-10-30 17:01:00 -0400
committerBen Myers <bpm@sgi.com>2013-10-30 17:01:00 -0400
commit643f7c4e5656bd18c769211f933190f7bb738245 (patch)
tree3231df34cf7dd872422a9191fc4b1430cff6927c /fs/xfs/xfs_log.c
parent5bf1f439c89d4653f8cc8f8aa303e0d6991aba4b (diff)
xfs: fix possible NULL dereference in xlog_verify_iclog
In xlog_verify_iclog a debug check of the incore log buffers prints an error if icptr is null and then goes on to dereference the pointer regardless. Convert this to an assert so that the intention is clear. This was reported by Coverty. Signed-off-by: Ben Myers <bpm@sgi.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r--fs/xfs/xfs_log.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index e523396753c5..49dd41e6a2dc 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -3710,11 +3710,9 @@ xlog_verify_iclog(
3710 /* check validity of iclog pointers */ 3710 /* check validity of iclog pointers */
3711 spin_lock(&log->l_icloglock); 3711 spin_lock(&log->l_icloglock);
3712 icptr = log->l_iclog; 3712 icptr = log->l_iclog;
3713 for (i=0; i < log->l_iclog_bufs; i++) { 3713 for (i = 0; i < log->l_iclog_bufs; i++, icptr = icptr->ic_next)
3714 if (icptr == NULL) 3714 ASSERT(icptr);
3715 xfs_emerg(log->l_mp, "%s: invalid ptr", __func__); 3715
3716 icptr = icptr->ic_next;
3717 }
3718 if (icptr != log->l_iclog) 3716 if (icptr != log->l_iclog)
3719 xfs_emerg(log->l_mp, "%s: corrupt iclog ring", __func__); 3717 xfs_emerg(log->l_mp, "%s: corrupt iclog ring", __func__);
3720 spin_unlock(&log->l_icloglock); 3718 spin_unlock(&log->l_icloglock);