]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: mtk-star-emac: fix error path in RX handling
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 27 May 2020 09:24:04 +0000 (11:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2020 18:24:31 +0000 (11:24 -0700)
commitef58246290a2449af53fceec037725d54e59ff52
tree3f2e3a5862bdbdfe455b23ad8cc888625cbafea9
parent47358b735d2f69f5abf7f9f7bb53e491a3d23549
net: ethernet: mtk-star-emac: fix error path in RX handling

The dma_addr field in desc_data must not be overwritten until after the
new skb is mapped. Currently we do replace it with uninitialized value
in error path. This change fixes it by moving the assignment before the
label to which we jump after mapping or allocation errors.

Fixes: 8c62308a9f55 ("net: ethernet: mtk-star-emac: new driver")
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com> # build
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mediatek/mtk_star_emac.c