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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 20:25:32 +0000 (13:25 -0700)
commitd727b2e78a1aefb26a1b3ee579712df15df51415
treeaf9098cdc08966005de508e2439ce7cffd9b6ead
parent839472b6fac9e330012e9de269cfba5ae01cca92
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c