David S. Miller wrote: > From: Patrick McHardy > Date: Wed, 07 Sep 2005 01:02:01 +0200 > > >>You're right, good catch. This patch fixes it by moving the lock >>down to the list-operation which it is supposed to protect. > > > I think we need to unlink from the list first if you're > going to do it this way. Otherwise someone can find the > protocol via lookup, and then bogusly try to use the SLAB > cache we're freeing up. > > Or does something else prevent this? The only other user of proto_list besides proto_register, which doesn't care, are the seqfs functions. They use the slab pointer, but in a harmless way: proto->slab == NULL ? "no" : "yes", Anyway, I've moved it up to the top.