Commit 52815e81 authored by Patrick Mochel's avatar Patrick Mochel

[driver model] Don't Oops when registering global sysdev drivers.

parent d507789a
......@@ -104,7 +104,7 @@ int sysdev_driver_register(struct sysdev_class * cls,
struct sysdev_driver * drv)
{
down_write(&system_subsys.rwsem);
if (kset_get(&cls->kset))
if (cls && kset_get(&cls->kset))
list_add_tail(&drv->entry,&cls->drivers);
else
list_add_tail(&drv->entry,&global_drivers);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment