提交 643f7c4e 编写于 作者: G Geyslan G. Bem 提交者: Ben Myers

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: NBen Myers <bpm@sgi.com>
Reviewed-by: NEric Sandeen <sandeen@redhat.com>
上级 5bf1f439
...@@ -3710,11 +3710,9 @@ xlog_verify_iclog( ...@@ -3710,11 +3710,9 @@ xlog_verify_iclog(
/* check validity of iclog pointers */ /* check validity of iclog pointers */
spin_lock(&log->l_icloglock); spin_lock(&log->l_icloglock);
icptr = log->l_iclog; icptr = log->l_iclog;
for (i=0; i < log->l_iclog_bufs; i++) { for (i = 0; i < log->l_iclog_bufs; i++, icptr = icptr->ic_next)
if (icptr == NULL) ASSERT(icptr);
xfs_emerg(log->l_mp, "%s: invalid ptr", __func__);
icptr = icptr->ic_next;
}
if (icptr != log->l_iclog) if (icptr != log->l_iclog)
xfs_emerg(log->l_mp, "%s: corrupt iclog ring", __func__); xfs_emerg(log->l_mp, "%s: corrupt iclog ring", __func__);
spin_unlock(&log->l_icloglock); spin_unlock(&log->l_icloglock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册