On Wednesday 30 May 2007, Christoph Hellwig wrote:
>
> > Is it documented or implied somewhere that ->shutdown must not free
> > the device? If not, the first option is probably the safer choice.
>
> It's not documented anywhere, but implicitly assumed. I don't know
> of any shutdown implementation that frees the device.
Right, I found the explanation now myself:
The ->shutdown method is called for system devices that are still
part of a linked linked list. Freeing the object would destroy that
list.
Geoff, please merge the patch below in your tree.
Arnd <><
---
Subject: cell: don't free spu objects in sysdev shutdown
From: Arnd Bergmann <[email protected]>
System devices are accessed after they are shut down, so
we must not free the data structures.
Signed-off-by: Arnd Bergmann <[email protected]>
Index: linux-2.6/arch/powerpc/platforms/cell/spu_base.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/spu_base.c
+++ linux-2.6/arch/powerpc/platforms/cell/spu_base.c
@@ -517,7 +517,6 @@ static int spu_shutdown(struct sys_devic
spu_free_irqs(spu);
spu_destroy_spu(spu);
- kfree(spu);
return 0;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]