WSL2-Linux-Kernel/drivers/net/can
Vincent Mailhol d1bedcd794 can: pch_can: pch_can_error(): initialize errc before using it
[ Upstream commit 9950f11211 ]

After commit 3a5c7e4611, the variable errc is accessed before being
initialized, c.f. below W=2 warning:

| In function 'pch_can_error',
|     inlined from 'pch_can_poll' at drivers/net/can/pch_can.c:739:4:
| drivers/net/can/pch_can.c:501:29: warning: 'errc' may be used uninitialized [-Wmaybe-uninitialized]
|   501 |                 cf->data[6] = errc & PCH_TEC;
|       |                             ^
| drivers/net/can/pch_can.c: In function 'pch_can_poll':
| drivers/net/can/pch_can.c:484:13: note: 'errc' was declared here
|   484 |         u32 errc, lec;
|       |             ^~~~

Moving errc initialization up solves this issue.

Fixes: 3a5c7e4611 ("can: pch_can: do not report txerr and rxerr during bus-off")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/all/20220721160032.9348-1-mailhol.vincent@wanadoo.fr
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 14:23:33 +02:00
..
c_can can: c_can: fix null-ptr-deref on ioctl() 2021-09-07 08:46:58 +02:00
cc770 can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
dev can: netlink: allow configuring of fixed data bit rates without need for do_set_data_bittiming callback 2022-08-17 14:23:20 +02:00
ifi_canfd can: dev: can_get_echo_skb(): extend to return can frame length 2021-01-14 08:43:43 +01:00
m_can can: m_can: m_can_{read_fifo,echo_tx_event}(): shift timestamp to full 32 bits 2022-07-12 16:34:49 +02:00
mscan can: mscan: mpc5xxx_can: mpc5xxx_can_probe(): remove useless BUG_ON() 2021-08-25 08:25:11 +02:00
peak_canfd can: peak_pciefd: pucan_handle_status(): fix a potential starvation issue in TX path 2021-06-24 08:40:10 +02:00
rcar can: rcar_can: do not report txerr and rxerr during bus-off 2022-08-17 14:23:32 +02:00
sja1000 can: sja1000: do not report txerr and rxerr during bus-off 2022-08-17 14:23:32 +02:00
softing can: softing: softing_startstop(): fix set but not used variable warning 2022-01-27 11:04:01 +01:00
spi can: hi311x: do not report txerr and rxerr during bus-off 2022-08-17 14:23:33 +02:00
usb can: usb_8dev: do not report txerr and rxerr during bus-off 2022-08-17 14:23:33 +02:00
Kconfig can: flexcan: update Kconfig to enable coldfire 2021-07-25 11:36:29 +02:00
Makefile can: dev: move driver related infrastructure into separate subdir 2021-01-13 09:42:58 +01:00
at91_can.c net: at91_can: fix the comments style issue 2021-07-25 11:36:27 +02:00
flexcan.c can: flexcan: add more quirks to describe RX path capabilities 2022-01-27 11:04:56 +01:00
grcan.c can: grcan: grcan_probe(): remove extra of_node_get() 2022-07-12 16:34:48 +02:00
janz-ican3.c can: janz-ican3: use DEVICE_ATTR_RO/RW() helper macro 2021-07-25 11:36:26 +02:00
kvaser_pciefd.c can: kvaser_pciefd: kvaser_pciefd_rx_error_frame(): increase correct stats->{rx,tx}_errors counter 2021-12-14 10:57:07 +01:00
led.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pch_can.c can: pch_can: pch_can_error(): initialize errc before using it 2022-08-17 14:23:33 +02:00
slcan.c tty: no checking of tty_unregister_ldisc 2021-05-13 16:57:17 +02:00
sun4i_can.c can: sun4i_can: do not report txerr and rxerr during bus-off 2022-08-17 14:23:33 +02:00
ti_hecc.c can: rx-offload: add skb queue for use during ISR 2021-07-25 11:36:25 +02:00
vcan.c net: introduce CAN specific pointer in the struct net_device 2021-02-24 14:32:15 -08:00
vxcan.c vxcan: enable local echo for sent CAN frames 2022-04-08 14:23:39 +02:00
xilinx_can.c Revert "can: xilinx_can: Limit CANFD brp to 2" 2022-07-21 21:24:40 +02:00