diff options
author | Jean-Baptiste Maneyrol <JManeyrol@invensense.com> | 2017-06-07 15:42:26 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2017-06-11 16:07:38 +0200 |
commit | 8a12ed7df7750778808c6feb0a5fd5725d2a8aeb (patch) | |
tree | ff232fb8d2c488a4147b5787041c10587e5caf1c /drivers/iio/imu/inv_mpu6050 | |
parent | iio: imu: inv_mpu6050: fix lock issues by using our own mutex (diff) | |
download | linux-8a12ed7df7750778808c6feb0a5fd5725d2a8aeb.tar.xz linux-8a12ed7df7750778808c6feb0a5fd5725d2a8aeb.zip |
iio: imu: inv_mpu6050: replace sprintf with scnprintf
Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/imu/inv_mpu6050')
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c index 9b4bbeea3d4f..60732e90ccfa 100644 --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c @@ -651,7 +651,8 @@ static ssize_t inv_attr_show(struct device *dev, struct device_attribute *attr, case ATTR_ACCL_MATRIX: m = st->plat_data.orientation; - return sprintf(buf, "%d, %d, %d; %d, %d, %d; %d, %d, %d\n", + return scnprintf(buf, PAGE_SIZE, + "%d, %d, %d; %d, %d, %d; %d, %d, %d\n", m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8]); default: return -EINVAL; |