Re: [PATCH 1/3] iio: adc: at91_adc: Repair broken platform_data support

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

 



On Wed, Mar 05, 2014 at 06:01:55PM +0100, Alexandre Belloni wrote:
> Trying to use the at91_adc driver while not using device tree is ending up in a
> kernel crash:
> 
> Unable to handle kernel NULL pointer dereference at virtual address 00000004
> [...]
> [<c01f3510>] (at91_adc_probe) from [<c0183828>] (platform_drv_probe+0x18/0x48)
> [<c0183828>] (platform_drv_probe) from [<c01824a4>] (driver_probe_device+0x100/0x218)
> [<c01824a4>] (driver_probe_device) from [<c0182648>] (__driver_attach+0x8c/0x90)
> [<c0182648>] (__driver_attach) from [<c0180de4>] (bus_for_each_dev+0x58/0x88)
> [<c0180de4>] (bus_for_each_dev) from [<c0181c7c>] (bus_add_driver+0xd4/0x1d4)
> [<c0181c7c>] (bus_add_driver) from [<c0182c40>] (driver_register+0x78/0xf4)
> [<c0182c40>] (driver_register) from [<c0008998>] (do_one_initcall+0xe8/0x14c)
> [<c0008998>] (do_one_initcall) from [<c02f0b50>] (kernel_init_freeable+0xec/0x1b4)
> [<c02f0b50>] (kernel_init_freeable) from [<c022acdc>] (kernel_init+0x8/0xe4)
> [<c022acdc>] (kernel_init) from [<c0009670>] (ret_from_fork+0x14/0x24)
> 
> This is because the at91_adc_caps structure is mandatory but is not filled when
> using platform_data. Correct that by using an id_table. It ensues that the
> driver will not match "at91_adc" anymore but it was crashing anyway.
> 
> Fixes: c46016665fff (iio: at91: ADC start-up time calculation changed since at91sam9x5)
> Cc: <stable@xxxxxxxxxxxxxxx> # v3.13+
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxxxxxxxxx>
> ---
>  drivers/iio/adc/at91_adc.c | 26 ++++++++++++++++++++++----
>  1 file changed, 22 insertions(+), 4 deletions(-)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
for how to do this properly.

</formletter>
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]