Skip to content

Commit 49e9705

Browse files
committed
GigaDevice targets can return ninitialized variable in CAN driver
1 parent a87c7c8 commit 49e9705

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

targets/TARGET_GigaDevice/TARGET_GD32E10X/can_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void can_free(can_t *obj)
305305
*/
306306
int can_frequency(can_t *obj, int hz)
307307
{
308-
int reval;
308+
int reval = 0;
309309

310310
/* The maximum baud rate support to 1M */
311311
if (hz <= 1000000) {

targets/TARGET_GigaDevice/TARGET_GD32F30X/can_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void can_free(can_t *obj)
305305
*/
306306
int can_frequency(can_t *obj, int hz)
307307
{
308-
int reval;
308+
int reval = 0;
309309

310310
/* The maximum baud rate support to 1M */
311311
if (hz <= 1000000) {

targets/TARGET_GigaDevice/TARGET_GD32F4XX/can_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void can_free(can_t *obj)
306306
*/
307307
int can_frequency(can_t *obj, int hz)
308308
{
309-
int reval;
309+
int reval = 0;
310310

311311
/* The maximum baud rate support to 1M */
312312
if (hz <= 1000000) {

0 commit comments

Comments
 (0)