public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix for buggy variable reuse in riotable.c (244ac18)
@ 2001-05-27 19:40 Rasmus Andersen
  0 siblings, 0 replies; only message in thread
From: Rasmus Andersen @ 2001-05-27 19:40 UTC (permalink / raw)
  To: linux-kernel

Forgot l-k when sending this off...

----- Forwarded message from Rasmus Andersen <rasmus@jaquet.dk> -----

Hi.

The following patch fixes a buggy variable reuse i drivers/char/
rio/riotable.c (244-ac18) as reported by the stanford team way
back.


--- linux-244-ac18-clean/drivers/char/rio/riotable.c	Sun May 27 20:19:56 2001
+++ linux-244-ac18/drivers/char/rio/riotable.c	Sun May 27 21:12:16 2001
@@ -501,7 +501,7 @@
 	struct Map *HostMapP;
 	struct Port *PortP;
 	int work_done = 0;
-	unsigned long flags;
+	unsigned long lock_flags, sem_flags;
 
 	rio_dprintk (RIO_DEBUG_TABLE, "Delete entry on host %x, rta %x\n",
 								MapP->HostUniqueNum, MapP->RtaUniqueNum);
@@ -509,10 +509,10 @@
 	for ( host=0; host < p->RIONumHosts; host++ ) {
 		HostP = &p->RIOHosts[host];
 
-		rio_spin_lock_irqsave( &HostP->HostLock, flags );
+		rio_spin_lock_irqsave( &HostP->HostLock, lock_flags );
 
 		if ( (HostP->Flags & RUN_STATE) != RC_RUNNING ) {
-			rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
+			rio_spin_unlock_irqrestore(&HostP->HostLock, lock_flags);
 			continue;
 		}
 
@@ -529,7 +529,7 @@
 					if ( HostMapP->Topology[link].Unit != ROUTE_DISCONNECT ) {
 						rio_dprintk (RIO_DEBUG_TABLE, "Entry is in use and cannot be deleted!\n");
 						p->RIOError.Error = UNIT_IS_IN_USE;
-						rio_spin_unlock_irqrestore( &HostP->HostLock, flags);
+						rio_spin_unlock_irqrestore( &HostP->HostLock, lock_flags);
 						return EBUSY;
 					}
 				}
@@ -544,7 +544,7 @@
 						PortP = p->RIOPortp[port];
 						rio_dprintk (RIO_DEBUG_TABLE, "Unmap port\n");
 
-						rio_spin_lock_irqsave( &PortP->portSem, flags );
+						rio_spin_lock_irqsave( &PortP->portSem, sem_flags );
 
 						PortP->Mapped = 0;
 
@@ -602,7 +602,7 @@
 							WWORD(PortP->PhbP->destination,
 							 dest_unit + (dest_port << 8));
 						}
-						rio_spin_unlock_irqrestore(&PortP->portSem, flags);
+						rio_spin_unlock_irqrestore(&PortP->portSem, sem_flags);
 					}
 				}
 				rio_dprintk (RIO_DEBUG_TABLE, "Entry nulled.\n");
@@ -610,7 +610,7 @@
 				work_done++;
 			}
 		}
-		rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
+		rio_spin_unlock_irqrestore(&HostP->HostLock, lock_flags);
 	}
 
 	/* XXXXX lock me up */
-- 
Regards,
        Rasmus(rasmus@jaquet.dk)

We're going to turn this team around 360 degrees.
-Jason Kidd, upon his drafting to the Dallas Mavericks

----- End forwarded message -----

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-27 19:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-27 19:40 [PATCH] fix for buggy variable reuse in riotable.c (244ac18) Rasmus Andersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox