Re: [PATCH] usb: musb: Check for NULL pointers when no OTG transceiver used

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

 



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?

--
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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux