On Thu, Aug 01, 2002 at 01:39:55PM -0400, anton wilson wrote: > driver_read(){ > spin_lockirq_save(&(data->spinlock), flags) > /* use data*/ > spinlock_irq_restore(&(data->spinlock), flags); > } > > driver_disconnect() > { > if(data) > { > kfree(data); > } > } > I see a problem here if for instance disconnect freed the data while read was > using it. Am I right? There is probably going to be a problem to use the lock when freeing the datastructure. If you move the lock somewhere else (say a hashtable of locks) you could then use the lock to protect the kfree(data);. -- http://www.wirex.com/
Attachment:
pgp00141.pgp
Description: PGP signature