summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-06-26 11:28:26 -0600
committerCommit Bot <commit-bot@chromium.org>2019-10-24 16:41:31 +0000
commit362bd9c25b04227c8f2af760aa1e25a35292f4be (patch)
treeaa21b63afbb3cc63d27b735e45983d6666358c36
parent952c0a91c0e2ef4984f1dfa01fbf38228d2be3e4 (diff)
downloadchrome-ec-362bd9c25b04227c8f2af760aa1e25a35292f4be.tar.gz
motionsense: remove panic
Remove a panic that should never happen. If there was a bug to make the EC go down that code path, it seems better to log and error about motion sense than take down the entire system with an EC panic. BRANCH=none TEST=builds BUG=none Change-Id: I6231b0b2bf14f9bcb3701040d0844f765d5637ad Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1678254 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> (cherry picked from commit aa329f49dc65ec251133fd745ef3f8fc16fd79eb) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1876303 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--common/motion_sense.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 39072e978b..bef6e77628 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -20,7 +20,6 @@
#include "mkbp_event.h"
#include "motion_sense.h"
#include "motion_lid.h"
-#include "panic.h"
#include "power.h"
#include "queue.h"
#include "tablet_mode.h"
@@ -279,8 +278,15 @@ static void motion_sense_fifo_stage_unit(
chunk = queue_get_write_chunk(
&motion_sense_fifo, fifo_staged.count);
- if (!chunk.buffer)
- panic("Failed to get write chunk for new fifo data");
+ if (!chunk.buffer) {
+ /*
+ * This should never happen since we already ensured there was
+ * space, but if there was a bug, we don't want to write to
+ * address 0. Just don't add any data to the queue instead.
+ */
+ CPRINTS("Failed to get write chunk for new fifo data!");
+ return;
+ }
/*
* Save the data to the writable block and increment count. This data