From 56cf05339f388a4d8de707cfcc77bf3230ccd715 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Mon, 15 Aug 2016 14:55:37 -0600 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/370663 Reviewed-by: David Hendricks Reviewed-by: Mary Ruthven --- chip/g/sps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);