fdcavalcanti commented on code in PR #9589:
URL: https://github.com/apache/nuttx/pull/9589#discussion_r1240545740


##########
drivers/sensors/mpu60x0.c:
##########
@@ -620,6 +639,12 @@ static inline int __mpu_write_gyro_config(FAR struct 
mpu_dev_s *dev,
 static inline int __mpu_write_accel_config(FAR struct mpu_dev_s *dev,
                                            uint8_t afs_sel)
 {
+  if (afs_sel > 3)
+    {
+      snerr("Invalid AFS_SEL value\n");
+      return -EINVAL;
+    }
+
   uint8_t val = TO_BITFIELD(ACCEL_CONFIG__AFS_SEL, afs_sel);

Review Comment:
   Thanks! Well observed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to