diff options
author | Achal Verma <achalv@nvidia.com> | 2021-04-14 00:22:42 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2021-08-13 16:10:52 -0400 |
commit | b476437caad5bb931afa75f0b1c5c7f4466ce24f (patch) | |
tree | 60ca9e02b31a27c52ba9b84c5c95d177413fffa9 | |
parent | a363ad9c09df7b3f5bd57c217c35f58fb9872738 (diff) |
mttcan: Fix uninitialized stack variable.
Stack variable should be initialized before use.
This fix coverity issue : 20384, 20383, 20382
Bug 200697818
Change-Id: Ibf6eab6c51f2348850bf3139146c513baf8657d0
Signed-off-by: Achal Verma <achalv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2575317
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Phoenix Jung <pjung@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/net/can/mttcan/hal/m_ttcan.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/can/mttcan/hal/m_ttcan.c b/drivers/net/can/mttcan/hal/m_ttcan.c index 9ccbde740..c650a17a6 100644 --- a/drivers/net/can/mttcan/hal/m_ttcan.c +++ b/drivers/net/can/mttcan/hal/m_ttcan.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2015-2020, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2015-2021, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -566,7 +566,7 @@ int ttcan_tx_fifo_full(struct ttcan_controller *ttcan) | |||
566 | 566 | ||
567 | static int process_rx_mesg(struct ttcan_controller *ttcan, u32 addr) | 567 | static int process_rx_mesg(struct ttcan_controller *ttcan, u32 addr) |
568 | { | 568 | { |
569 | struct ttcanfd_frame ttcanfd; | 569 | struct ttcanfd_frame ttcanfd = {0}; |
570 | ttcan_read_rx_msg_ram(ttcan, addr, &ttcanfd); | 570 | ttcan_read_rx_msg_ram(ttcan, addr, &ttcanfd); |
571 | return add_msg_controller_list(ttcan, &ttcanfd, &ttcan->rx_b, BUFFER); | 571 | return add_msg_controller_list(ttcan, &ttcanfd, &ttcan->rx_b, BUFFER); |
572 | } | 572 | } |
@@ -655,7 +655,7 @@ unsigned int ttcan_read_txevt_fifo(struct ttcan_controller *ttcan) | |||
655 | unsigned int ttcan_read_rx_fifo0(struct ttcan_controller *ttcan) | 655 | unsigned int ttcan_read_rx_fifo0(struct ttcan_controller *ttcan) |
656 | { | 656 | { |
657 | u32 rxf0s_reg; | 657 | u32 rxf0s_reg; |
658 | struct ttcanfd_frame ttcanfd; | 658 | struct ttcanfd_frame ttcanfd = {0}; |
659 | u32 read_addr; | 659 | u32 read_addr; |
660 | int q_read = 0; | 660 | int q_read = 0; |
661 | unsigned int msgs_read = 0; | 661 | unsigned int msgs_read = 0; |
@@ -702,7 +702,7 @@ unsigned int ttcan_read_rx_fifo0(struct ttcan_controller *ttcan) | |||
702 | unsigned int ttcan_read_rx_fifo1(struct ttcan_controller *ttcan) | 702 | unsigned int ttcan_read_rx_fifo1(struct ttcan_controller *ttcan) |
703 | { | 703 | { |
704 | u32 rxf1s_reg; | 704 | u32 rxf1s_reg; |
705 | struct ttcanfd_frame ttcanfd; | 705 | struct ttcanfd_frame ttcanfd = {0}; |
706 | u32 read_addr; | 706 | u32 read_addr; |
707 | int q_read = 0; | 707 | int q_read = 0; |
708 | int msgs_read = 0; | 708 | int msgs_read = 0; |