diff options
author | norly <ny-git@enpas.org> | 2019-02-14 19:22:20 +0100 |
---|---|---|
committer | norly <ny-git@enpas.org> | 2019-02-18 00:48:47 +0100 |
commit | 5698ee2f40c0459c83136496bb0418f3e0f9271b (patch) | |
tree | f95d0db88dc08e8b516a634241c9e0b3547872f4 | |
parent | 88eb76e031c7e01199c501865c4622cec7a59185 (diff) |
Null stack variables before use
-rw-r--r-- | module/elmcan.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/module/elmcan.c b/module/elmcan.c index 3724d97..1c1465f 100644 --- a/module/elmcan.c +++ b/module/elmcan.c @@ -335,8 +335,9 @@ static void elm327_feed_frame_to_netdev(struct elmcan *elm, const struct can_fra /* Called when we're out of ideas and just want it all to end. */ static inline void elm327_hw_failure(struct elmcan *elm) { - struct can_frame frame = {0}; + struct can_frame frame; + memset(&frame, 0, sizeof(frame)); frame.can_id = CAN_ERR_FLAG; frame.can_dlc = CAN_ERR_DLC; frame.data[5] = 'R'; @@ -361,8 +362,9 @@ static inline void elm327_hw_failure(struct elmcan *elm) static void elm327_parse_error(struct elmcan *elm, int len) { - struct can_frame frame = {0}; + struct can_frame frame; + memset(&frame, 0, sizeof(frame)); frame.can_id = CAN_ERR_FLAG; frame.can_dlc = CAN_ERR_DLC; @@ -420,11 +422,13 @@ static void elm327_parse_error(struct elmcan *elm, int len) static int elm327_parse_frame(struct elmcan *elm, int len) { - struct can_frame frame = {0}; + struct can_frame frame; int hexlen; int datastart; int i; + memset(&frame, 0, sizeof(frame)); + /* Find first non-hex and non-space character: * - In the simplest case, there is none. * - For RTR frames, 'R' is the first non-hex character. |