RE: [PATCH] Fix null pointer error after vmbus loading

From: Haiyang Zhang
Date: Fri Oct 23 2009 - 12:22:35 EST


> -----Original Message-----
> From: Greg KH [mailto:gregkh@xxxxxxx]
> But this is not how you check to see if your device is registered at
> all, you can not rely on the driver core to have the name set or not to
> reflect the status of the device. Devices have many stages in their
> lifecycle, and the name reliably shows none of them.
>
> Actually, why do you need to know this? Shouldn't you always know the
> state of your device, how can you get passed an unregistered device?

I have traced down the callers to the function, vmbus_child_device_register(),
and verified that the struct device was kzalloc-ed by the current thread,
and not visible to other threads before we register the device. So the
dev name is always NULL here, we can skip the NULL & strlen checking. I
will send you the new patch soon.

Thanks,

- Haiyang

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/