]> git.baikalelectronics.ru Git - kernel.git/commit
net: lantiq_xrx200: confirm skb is allocated before using
authorAleksander Jan Bajkowski <olek2@wp.pl>
Wed, 24 Aug 2022 21:54:06 +0000 (23:54 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Aug 2022 19:41:38 +0000 (12:41 -0700)
commit4c6bbf1c7eaf745b6ca507b315596e3ebccf9275
tree8c74a7e4a530a6e81e78362a455922335c4f30f1
parent8c6db38ed5d3fb5dfbbd58061afce181e1be07e4
net: lantiq_xrx200: confirm skb is allocated before using

xrx200_hw_receive() assumes build_skb() always works and goes straight
to skb_reserve(). However, build_skb() can fail under memory pressure.

Add a check in case build_skb() failed to allocate and return NULL.

Fixes: 0edcf29e78ce ("net: lantiq_xrx200: convert to build_skb")
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/lantiq_xrx200.c