On Mon, Jun 29, 2009 at 09:25:49AM +0200, Quadros Roger (EXT-Teleca/Helsinki) wrote: > Felipe Balbi wrote: > > Hi, > > > > On Mon, Jun 29, 2009 at 09:04:36AM +0200, Quadros Roger (EXT-Teleca/Helsinki) wrote: > >> Even if we force transceiver selection in Kconfig, it is possible that the board > >> files do not declare the OTG transceiver (e.g. the current rx51 board files) and > >> hence otg_set_transceiver() is never called. This will lead to a kernel crash at > >> musb_free() and musb_platform_exit(). IMHO we should check for NULL pointers anyway. > >> > >> I will resend the patch with formatting fixes. > > > > That's a problem of who wrote the board-file. The driver must expect > > this pointer to be valid. That way we can easily find problems with > > board-files missing transceiver initialization. > > > > Yes it may be the problem with the board-file or board writer may temporarily > not want to declare OTG due to some reason. > Since the crash happens before console is initialized, we really can't see the > cause of the error. > Wouldn't it be better to print an error message than to let the kernel lock up? Then people wouldn't care about the error message. Maybe WARN() if that pointer is null and otg is enabled. -- balbi -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html