mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00

* kernel: crypto: add atmel i2c hw accelerator support Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org> * kernel: add led act/polarity select for rtl8221 phy Signed-off-by: Tianling Shen <cnsztl@gmail.com> * mediatek: add support for OpenEmbed SOM7981 Hardware specification: SoC: MediaTek MT7981B 2x A53 Flash: 256 MiB SPI-NAND RAM: 0.5/1 GB DDR4 Ethernet: 1x 1GbE, 1x 2.5GbE (RTL8221B) WiFi: MediaTek MT7976C USB: 1x M.2 B-Key GPIO: 26-Pin header UART: 6 GND, 8 TX, 10 RX (in Pin header) Button: Reset Installation: The board comes with a third-party custom OpenWrt image, you can upload sysupgrade image via LuCI directly WITHOUT keeping configurations. Or power on the board with pressing reset button for 5 second, then visit http://192.168.1.1 and upload -factory.bin firmware. Signed-off-by: Tianling Shen <cnsztl@gmail.com> --------- Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org> Signed-off-by: Tianling Shen <cnsztl@gmail.com>
45 lines
1.5 KiB
Diff
45 lines
1.5 KiB
Diff
From e10a35abb3da12b812cfb6fc6137926a0c81e39a Mon Sep 17 00:00:00 2001
|
|
From: Daniel Golle <daniel@makrotopia.org>
|
|
Date: Sun, 10 Sep 2023 22:40:30 +0100
|
|
Subject: [PATCH] net: ethernet: mtk_eth_soc: fix uninitialized variable
|
|
|
|
Variable dma_addr in function mtk_poll_rx can be uninitialized on
|
|
some of the error paths. In practise this doesn't matter, even random
|
|
data present in uninitialized stack memory can safely be used in the
|
|
way it happens in the error path.
|
|
|
|
However, in order to make Smatch happy make sure the variable is
|
|
always initialized.
|
|
|
|
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
---
|
|
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
|
@@ -1940,11 +1940,11 @@ static int mtk_poll_rx(struct napi_struc
|
|
u8 *data, *new_data;
|
|
struct mtk_rx_dma_v2 *rxd, trxd;
|
|
int done = 0, bytes = 0;
|
|
+ dma_addr_t dma_addr = DMA_MAPPING_ERROR;
|
|
|
|
while (done < budget) {
|
|
unsigned int pktlen, *rxdcsum;
|
|
struct net_device *netdev;
|
|
- dma_addr_t dma_addr;
|
|
u32 hash, reason;
|
|
int mac = 0;
|
|
|
|
@@ -2121,7 +2121,8 @@ release_desc:
|
|
else
|
|
rxd->rxd2 = RX_DMA_PREP_PLEN0(ring->buf_size);
|
|
|
|
- if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA))
|
|
+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_36BIT_DMA) &&
|
|
+ likely(dma_addr != DMA_MAPPING_ERROR))
|
|
rxd->rxd2 |= RX_DMA_PREP_ADDR64(dma_addr);
|
|
|
|
ring->calc_idx = idx;
|