linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/7] iio: imu: inv_mpu6050: replace sprintf with scnprintf
@ 2017-06-07 13:42 Jean-Baptiste Maneyrol
  2017-06-11 12:45 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Jean-Baptiste Maneyrol @ 2017-06-07 13:42 UTC (permalink / raw)
  To: linux-iio

Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/i=
nv_mpu6050/inv_mpu_core.c
index 37fb18f..64af12c 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
@@ -684,7 +684,8 @@ static ssize_t inv_attr_show(struct device *dev, struct=
 device_attribute *attr,
 	case ATTR_ACCL_MATRIX:
 		m =3D st->plat_data.orientation;
=20
-		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;
--=20
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-11 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-07 13:42 [PATCH v2 2/7] iio: imu: inv_mpu6050: replace sprintf with scnprintf Jean-Baptiste Maneyrol
2017-06-11 12:45 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).