net: qualcomm: rmnet: move null check on dev before dereferecing it
authorColin Ian King <colin.king@canonical.com>
Sat, 24 Nov 2018 15:03:02 +0000 (15:03 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:51:43 +0000 (08:51 +0100)
commitbaf4915acc2a9c1e117693da08f9856da64d271d
tree900ffd280546f752a2c8a22bb664d97b64291a7a
parentc2160296f10fe42e74a936e6cf5e6ff99edecf9a
net: qualcomm: rmnet: move null check on dev before dereferecing it

[ Upstream commit 3c18aa1464f9232d6abac8d7b4540f61b0658d62 ]

Currently dev is dereferenced by the call dev_net(dev) before dev is null
checked.  Fix this by null checking dev before the potential null
pointer dereference.

Detected by CoverityScan, CID#1462955 ("Dereference before null check")

Fixes: 23790ef12082 ("net: qualcomm: rmnet: Allow to configure flags for existing devices")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c