mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
iio: frequency: adf4377: reject devices without match data
A device bound through driver_override need not match an entry in the
driver tables. In that case spi_get_device_match_data() returns NULL,
but the result is later dereferenced by the property parsing and
initialization paths.
Reject devices without match data before continuing probe.
Fixes: 6140a92cd0 ("iio: frequency: adf4377: add adf4378 support")
Signed-off-by: Jiale Yao <yaojiale02@163.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
parent
6ac1faf4de
commit
2f3196d27e
|
|
@ -1060,6 +1060,9 @@ static int adf4377_probe(struct spi_device *spi)
|
|||
st->regmap = regmap;
|
||||
st->spi = spi;
|
||||
st->chip_info = spi_get_device_match_data(spi);
|
||||
if (!st->chip_info)
|
||||
return -ENODATA;
|
||||
|
||||
mutex_init(&st->lock);
|
||||
|
||||
ret = adf4377_properties_parse(st);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user