All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: fix possible NULL dereference
@ 2013-10-21 18:32 ` Geyslan G. Bem
  0 siblings, 0 replies; 43+ messages in thread
From: Geyslan G. Bem @ 2013-10-21 18:32 UTC (permalink / raw)
  To: kernel-br
  Cc: Alex Elder, Ben Myers, Geyslan G. Bem, open list,
	supporter:XFS FILESYSTEM

This patch puts a 'break' in the true branch, avoiding the 'icptr->ic_next'
dereferencing.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 fs/xfs/xfs_log.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index a2dea108..8cdeb7e 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -3703,8 +3703,10 @@ xlog_verify_iclog(
 	spin_lock(&log->l_icloglock);
 	icptr = log->l_iclog;
 	for (i=0; i < log->l_iclog_bufs; i++) {
-		if (icptr == NULL)
+		if (!icptr) {
 			xfs_emerg(log->l_mp, "%s: invalid ptr", __func__);
+			break;
+		}
 		icptr = icptr->ic_next;
 	}
 	if (icptr != log->l_iclog)
-- 
1.8.4

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2013-10-31 16:16 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-21 18:32 [PATCH] xfs: fix possible NULL dereference Geyslan G. Bem
2013-10-21 18:32 ` Geyslan G. Bem
2013-10-21 20:58 ` Eric Sandeen
2013-10-21 22:44   ` Dave Chinner
2013-10-21 22:44     ` Dave Chinner
2013-10-21 23:12     ` Eric Sandeen
2013-10-21 23:12       ` Eric Sandeen
2013-10-21 23:18       ` Ben Myers
2013-10-21 23:18         ` Ben Myers
2013-10-21 23:56         ` Dave Chinner
2013-10-21 23:56           ` Dave Chinner
2013-10-22  0:00           ` Eric Sandeen
2013-10-22  0:00             ` Eric Sandeen
2013-10-22  0:17             ` Dave Chinner
2013-10-22  0:17               ` Dave Chinner
2013-10-22 10:12               ` Geyslan Gregório Bem
2013-10-22 10:12                 ` Geyslan Gregório Bem
2013-10-22 20:39                 ` Dave Chinner
2013-10-22 20:39                   ` Dave Chinner
2013-10-22 20:49                   ` Eric Sandeen
2013-10-22 20:49                     ` Eric Sandeen
2013-10-22 21:03                     ` Dave Chinner
2013-10-22 21:03                       ` Dave Chinner
2013-10-22 21:19                       ` Eric Sandeen
2013-10-22 21:19                         ` Eric Sandeen
2013-10-22 22:02                         ` Dave Chinner
2013-10-22 22:02                           ` Dave Chinner
2013-10-22 22:33                           ` Ben Myers
2013-10-22 22:33                             ` Ben Myers
2013-10-25  9:15                           ` Dave Jones
2013-10-25  9:15                             ` Dave Jones
2013-10-23 10:58                         ` Geyslan Gregório Bem
2013-10-23 10:58                           ` Geyslan Gregório Bem
2013-10-23 20:34                           ` Ben Myers
2013-10-23 20:34                             ` Ben Myers
2013-10-23 20:53                             ` Geyslan Gregório Bem
2013-10-23 20:53                               ` Geyslan Gregório Bem
2013-10-30 20:08                             ` Eric Sandeen
2013-10-30 20:08                               ` Eric Sandeen
2013-10-31 15:55                               ` Ben Myers
2013-10-31 15:55                                 ` Ben Myers
2013-10-31 16:15                                 ` Geyslan Gregório Bem
2013-10-31 16:15                                   ` Geyslan Gregório Bem

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.