login
Header Space

 
 

[patch 34/37] SCSI: aha152x: Fix oops on module removal

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <stable@...>, <jejb@...>
Cc: Justin Forbes <jmforbes@...>, Zwane Mwaikambo <zwane@...>, Theodore Ts'o <tytso@...>, Randy Dunlap <rdunlap@...>, Dave Jones <davej@...>, Chuck Wolber <chuckw@...>, Chris Wedgwood <reviews@...>, Michael Krufky <mkrufky@...>, Chuck Ebbert <cebbert@...>, Domenico Andreoli <cavokz@...>, <torvalds@...>, <akpm@...>, <alan@...>, James Bottomley <James.Bottomley@...>
Date: Tuesday, May 13, 2008 - 4:12 pm

2.6.25-stable review patch.  If anyone has any objections, please let us
know.

------------------
From: James Bottomley <James.Bottomley@HansenPartnership.com>

commit 64976a0387835a7ac61bbe2a99b27ccae34eac5d upstream

Reported-by: Frank de Jong <frapex@xs4all.nl>

The problem is that the driver calls aha152x_release() under a
list_for_each_entry().  Unfortunately, aha152x_release() deletes from
the list in question.  Fix this by using list_for_each_entry_safe().

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/scsi/aha152x.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -3919,9 +3919,9 @@ static int __init aha152x_init(void)
 
 static void __exit aha152x_exit(void)
 {
-	struct aha152x_hostdata *hd;
+	struct aha152x_hostdata *hd, *tmp;
 
-	list_for_each_entry(hd, &aha152x_host_list, host_list) {
+	list_for_each_entry_safe(hd, tmp, &aha152x_host_list, host_list) {
 		struct Scsi_Host *shost = container_of((void *)hd, struct Scsi_Host, hostdata);
 
 		aha152x_release(shost);

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/37] 2.6.25.4 -stable review, Greg KH, (Tue May 13, 4:10 pm)
[patch 37/37] md: fix raid5 repair operations, Greg KH, (Tue May 13, 4:12 pm)
[patch 34/37] SCSI: aha152x: Fix oops on module removal, Greg KH, (Tue May 13, 4:12 pm)
[patch 24/37] sparc: Fix ptrace() detach., Greg KH, (Tue May 13, 4:12 pm)
Re: Hardware designt to prevent Damages... [WAS: [patch 23/3..., Michelle Konzack, (Fri May 16, 11:22 am)
Re: Hardware designt to prevent Damages... [WAS: [patch 23/3..., linux-os (Dick Johnson), (Thu May 15, 1:57 pm)
Re: [patch 22/37] x86: sysfs cpu?/topology is empty in 2.6.2..., Vaidyanathan Srinivasan, (Thu May 15, 2:06 pm)
Re: [patch 20/37] {nfnetlink, ip, ip6}_queue: fix skb_over_p..., Gustavo Guillermo Perez, (Wed May 14, 12:45 pm)
[patch 06/37] sparc: sunzilog uart order, Greg KH, (Tue May 13, 4:11 pm)
speck-geostationary