On Friday, November 15, 2013 05:03:57 PM Shuah Khan wrote:return -EINVAL;device_wakeup_enable() uses dev_name(dev) as the wakeup source name.
When it gets called with a device with its name not yet set, ws structure
with ws->name = NULL gets created.
When kernel is booted with wakeup_source_activate enabled, it will panic
when the trace point code tries to derefernces ws->name.
Change device_wakeup_enable() to check for dev_name(dev) null condition
and return -EINVAL to avoid panics when device_wakeup_enable() gets called
before device is fully initialized with its name.
Can you please use WARN_ON(!dev_name(dev)) here? While I agree that it is a
bad idea to crash the kernel because dev has no name, that indicates a driver
bug that shouldn't be too easy to ignore.
Thanks!