OSDN Git Service

iio: core: check 'info' value before registering the device
authorAndi Shyti <andi@etezian.org>
Sun, 2 Dec 2018 18:30:31 +0000 (20:30 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 8 Dec 2018 11:06:41 +0000 (11:06 +0000)
commitd45ebf1f986db608e0c7d69e8792ee85c9b7f3f4
treeb63473d6d3d84245e4b77f235a7fd542e8156fbd
parent794e20ee038ea368f3f099d196792b024fb3170c
iio: core: check 'info' value before registering the device

When the 'info' structure inside indio_dev is left uninitialized,
a segmentation fault occurs.

Check the 'info' value before using it and if it is equal to
NULL, return with -EINVAL.

Signed-off-by: Andi Shyti <andi@etezian.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c