net: ipa: skip SKB copy if no netdev
authorAlex Elder <elder@linaro.org>
Wed, 24 Nov 2021 20:25:09 +0000 (14:25 -0600)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Nov 2021 03:37:34 +0000 (19:37 -0800)
commit1b65bbcc9a71012003511b23b02b32db5c2f1adb
treed9773345fc1747bb90a540f129447bb5dab2822f
parent01c36637aeaf5d3e74be4d8e00e8f4e62857dac0
net: ipa: skip SKB copy if no netdev

In ipa_endpoint_skb_copy(), a new socket buffer structure is
allocated so that some data can be copied into it.  However, after
doing this, if the endpoint has a null netdev pointer, we just drop
free the socket buffer.

Instead, check endpoint->netdev pointer first, and just return early
if it's null.  Also return early if the SKB allocation fails, to
avoid the deeper indentation in the normal path.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_endpoint.c