diff options
author | Martin Roth <martinroth@chromium.org> | 2016-08-15 14:55:37 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-08-22 23:27:18 -0700 |
commit | 56cf05339f388a4d8de707cfcc77bf3230ccd715 (patch) | |
tree | cea9a2b0984b077f3c82ac27835a61345d39efe1 /chip | |
parent | 61c45fb33e9ea1b1db6e195c093b02444d303cce (diff) | |
download | chrome-ec-56cf05339f388a4d8de707cfcc77bf3230ccd715.tar.gz |
chip/g/sps: Initialize received_data pointer to NULL
I don't think that the received_data pointer in sps_rx_interrupt can
actually be used without initialization in the current code flow, but
GCC 5.3 thinks that it can, and throws an error.
sps_check_rx() always sets the pointer or returns 0. In either case
we should be ok, but initializing it to null here won't hurt anything
since it's not masking an actual error.
BUG=None
BRANCH=None
TEST=Build all boards successfully.
Change-Id: Idaea7efd1af3067c492a3ade4c89104e975f4c1d
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/370663
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/g/sps.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/g/sps.c b/chip/g/sps.c index 0ce1d6be41..923e39398c 100644 --- a/chip/g/sps.c +++ b/chip/g/sps.c @@ -315,7 +315,7 @@ static void sps_advance_rx(int port, int data_size) static void sps_rx_interrupt(uint32_t port, int cs_deasserted) { for (;;) { - uint8_t *received_data; + uint8_t *received_data = NULL; size_t data_size; data_size = sps_check_rx(port, &received_data); |