Please apply.

Resending modified patch that passes checkpatch.pl


This patch prevents the SEGV that is triggered when an I/O is aborted/timedout.



>From 4b42e7be6012d2b7b7e119ee7dd806e0bb1732cd Mon Sep 17 00:00:00 2001
From: Ronnie Sahlberg <[EMAIL PROTECTED]>
Date: Mon, 7 Jul 2008 12:53:13 +1000
Subject: [PATCH] Make sure that ->prev and ->next are non-NULL
 before we call __list_del() and dereference them.

Signed-off-by: Ronnie Sahlberg <[EMAIL PROTECTED]>
---
 usr/list.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/usr/list.h b/usr/list.h
index 4d76057..12e6b06 100644
--- a/usr/list.h
+++ b/usr/list.h
@@ -82,6 +82,9 @@ static inline void __list_del(struct list_head *
prev, struct list_head * next)

 static inline void list_del(struct list_head *entry)
 {
+       if ((entry->prev == NULL) && (entry->next == NULL))
+               return;
+
        __list_del(entry->prev, entry->next);
        entry->next = entry->prev = NULL;
 }
-- 
1.5.4.3
_______________________________________________
Stgt-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/stgt-devel

Reply via email to