summaryrefslogtreecommitdiffstats
path: root/drivers/iio/gyro
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2012-10-27 16:03:00 +0100
committerJonathan Cameron <jic23@kernel.org>2012-11-17 10:17:28 +0000
commit64ebe955f9447fcecf65360ec3bc332f4ec411b6 (patch)
tree73ef17a2dd1c4f6958facd12b2516c55342f454a /drivers/iio/gyro
parent95273f8952a7e3a037e139eec0aa99872f086498 (diff)
downloadblackbird-op-linux-64ebe955f9447fcecf65360ec3bc332f4ec411b6.tar.gz
blackbird-op-linux-64ebe955f9447fcecf65360ec3bc332f4ec411b6.zip
iio: hid-sensor: Return proper error if kmemdup fails
Return -ENOMEM instead of 0 if kmemdup fails. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r--drivers/iio/gyro/hid-sensor-gyro-3d.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index 02ef989b830d..4c8b158e40e1 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -306,10 +306,10 @@ static int __devinit hid_gyro_3d_probe(struct platform_device *pdev)
goto error_free_dev;
}
- channels = kmemdup(gyro_3d_channels,
- sizeof(gyro_3d_channels),
- GFP_KERNEL);
+ channels = kmemdup(gyro_3d_channels, sizeof(gyro_3d_channels),
+ GFP_KERNEL);
if (!channels) {
+ ret = -ENOMEM;
dev_err(&pdev->dev, "failed to duplicate channels\n");
goto error_free_dev;
}
OpenPOWER on IntegriCloud