[PATCH 6/7] aacraid: unlock around kfree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Received from Mark Salyzyn from Adaptec:

kfree has the possibility of sleeping. It is generally considered poor
manners to hold on to a lock with the possibility of a system call
induced sleep.

Applies to scsi-misc-2.6 git tree

Signed-off-by: Mark Haverkamp <markh@xxxxxxxx>

Index: scsi-misc-aac-1/drivers/scsi/aacraid/commctrl.c
===================================================================
--- scsi-misc-aac-1.orig/drivers/scsi/aacraid/commctrl.c	2005-07-05 14:18:07.000000000 -0700
+++ scsi-misc-aac-1/drivers/scsi/aacraid/commctrl.c	2005-07-05 14:59:24.000000000 -0700
@@ -324,8 +324,10 @@
 		/*
 		 *	Free the space occupied by this copy of the fib.
 		 */
+		spin_unlock_irq(&dev->fib_lock);
 		kfree(fib->hw_fib);
 		kfree(fib);
+		spin_lock_irq(&dev->fib_lock);
 	}
 	/*
 	 *	Remove the Context from the AdapterFibContext List
@@ -338,7 +340,9 @@
 	/*
 	 *	Free the space occupied by the Context
 	 */
+	spin_unlock_irq(&dev->fib_lock);
 	kfree(fibctx);
+	spin_lock_irq(&dev->fib_lock);
 	return 0;
 }
 

-- 
Mark Haverkamp <markh@xxxxxxxx>

-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux