]> 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)
commit80ff4c2bbe0b01f25a6b0bb4ed1b7b37da333b01
tree8c74a7e4a530a6e81e78362a455922335c4f30f1
parent74daaf75f4045628b2cca7fd60cc18acde9d1231
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: db170c7252e8 ("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