aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-01-07 21:43:59 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-01 09:37:09 +0000
commit284cd2ab3c358dbcec1332eba11640741e3d8058 (patch)
tree420a9902f7a885fe598508671b45861213ab8854
parent4fce6b14f29d469bdfe9540ea8ad6c4c7a4a318c (diff)
downloadlinux-yocto-284cd2ab3c358dbcec1332eba11640741e3d8058.tar.gz
linux-yocto-284cd2ab3c358dbcec1332eba11640741e3d8058.tar.bz2
linux-yocto-284cd2ab3c358dbcec1332eba11640741e3d8058.zip
atm: eni: fix uninitialized variable warning
[ Upstream commit 30780d086a83332adcd9362281201cee7c3d9d19 ] With -O3, gcc has found an actual unintialized variable stored into an mmio register in two instances: drivers/atm/eni.c: In function 'discard': drivers/atm/eni.c:465:13: error: 'dma[1]' is used uninitialized in this function [-Werror=uninitialized] writel(dma[i*2+1],eni_dev->rx_dma+dma_wr*8+4); ^ drivers/atm/eni.c:465:13: error: 'dma[3]' is used uninitialized in this function [-Werror=uninitialized] Change the code to always write zeroes instead. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/atm/eni.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index 6470e3c4c990..7323e9210f4b 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -372,7 +372,7 @@ static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb,
here = (eni_vcc->descr+skip) & (eni_vcc->words-1);
dma[j++] = (here << MID_DMA_COUNT_SHIFT) | (vcc->vci
<< MID_DMA_VCI_SHIFT) | MID_DT_JK;
- j++;
+ dma[j++] = 0;
}
here = (eni_vcc->descr+size+skip) & (eni_vcc->words-1);
if (!eff) size += skip;
@@ -445,7 +445,7 @@ static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb,
if (size != eff) {
dma[j++] = (here << MID_DMA_COUNT_SHIFT) |
(vcc->vci << MID_DMA_VCI_SHIFT) | MID_DT_JK;
- j++;
+ dma[j++] = 0;
}
if (!j || j > 2*RX_DMA_BUF) {
printk(KERN_CRIT DEV_LABEL "!j or j too big!!!\n");