[RFC][2.5] list_for_each_safe not so safe (was Re: OOPS w83781d during rmmod (2.5.70-bk1[1234]))

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

 



On Fri, 2003-06-13 at 04:36, Mark M. Hoffman wrote:

> > Nope, this do not fix it.
> > 
> > The problem is actually at the i2c driver side.  From
> > drivers/i2c/i2c-core.c in i2c_del_driver(), we have:
> <cut>
> 
> To recap:  list_for_each_safe() is not safe for deleting other than
> the current "item".  But I disagree with you Martin because I think
> the usage in i2c_del_driver is ok as is; and that w83781d.c should
> change...
> 

Right, I will not argue, as I was not sure on usage (and thus the
mail).  Might be right thing (tm) to send a patch to make it more
clear that its only 'safe' for current item deletion (against
list.h) ?

> My first patch was naive; the patch below solves the problem by
> letting w83781d_detach_client remove the three clients (1 * primary
> + 2 * subclients) independently.  It's a noisy patch because I had
> to change the way the subclients were kmalloc'ed - sorry.  The meat
> is around line 1422.  This patch works for me... comments?
> 

I did try this way, but did it rather brutish =)  It thus still did
not fix it.  Your patch looks good ... I will try it tonight at home.


Regards,

-- 
Martin Schlemmer




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux