Skip to content
Commit 41be6a0d authored by Manfred Schlaegl's avatar Manfred Schlaegl Committed by Jonathan Cameron
Browse files

iio: mcp320x: Fix NULL pointer dereference



On reading in_voltage_scale of we got an NULL pointer dereference Oops.

The reason for this is, that mcp320x_read_raw tries to access
chip_info->resolution from struct mcp320x, but chip_info is never set.

chip_info was never set since the driver was added, but there was no
acute problem, because it was not referenced.
The acute problem exists since
b12206e9
iio: adc: mcp320x. Add support for more ADCs

This patch fixes the issue by setting chip_info in mcp320x_probe.

Signed-off-by: default avatarManfred Schlaegl <manfred.schlaegl@gmx.at>
Reviewed-by: default avatarMichael Welling <mwelling@ieee.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent bf604a4c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment