iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference
authorAtilla Filiz <atilla.filiz@essensium.com>
Fri, 11 Apr 2014 14:51:23 +0000 (16:51 +0200)
committerJiri Slaby <jslaby@suse.cz>
Fri, 6 Jun 2014 10:38:18 +0000 (12:38 +0200)
commit361f937995467af9221608315b6db80766ca5ef4
tree37b93dab4d6b1e78b9004ec786c0cea79ff81dbb
parent1c982327c143125d3fc60763e6d8924b3bb6f028
iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference

commit b9b3a41893c3f1be67b5aacfa525969914bea0e9 upstream.

The driver segfaults when the kernel boots with device tree as the
platform data is then not present and the pointer is deferenced without
checking it is not null.  This patch introduces such a check avoiding the
crash.

Signed-off-by: Atilla Filiz <atilla.filiz@essensium.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c