[PATCH] ARM: pxa: make pwm driver module_platform_driver
Robert Jarzmik
robert.jarzmik at free.fr
Thu Aug 8 16:38:17 EDT 2013
Mike Dunn <mikedunn at newsguy.com> writes:
> Commit 76abbdde2d95a3807d0dc6bf9f84d03d0dbd4f3d
>
> pwm: Add sysfs interface
>
> causes a kernel oops due to a null pointer dereference on pxa platforms. This
> happens because the class added by the patch is registered in a subsys_initcall
> (initcall4), but the pxa pwm driver is registered in arch_initcall (initcall3).
> If the class is not registered before the driver probe function runs, the oops
> occurs in device_add() when the uninitialized pointers in struct class are
> dereferenced. I don't see a reason that the driver must be an arch_initcall, so
> this patch makes it a regular module_platform_driver (initcall6), preventing the
> oops.
That makes sense.
The only users I'm aware of for PWM on pxa is backlight, and that can certainly
wait for regular driver initcall level. I'm not aware of any usage in early boot
stages.
Acked-by: Robert Jarzmik <robert.jarzmik at free.fr>
--
Robert
More information about the linux-arm-kernel
mailing list