Re: [PATCH] net: qualcomm: rmnet: move null check on dev before dereferecing it

From: David Miller
Date: Sat Nov 24 2018 - 20:40:56 EST


From: Colin King <colin.king@xxxxxxxxxxxxx>
Date: Sat, 24 Nov 2018 15:03:02 +0000

> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> 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@xxxxxxxxxxxxx>

Applied to net-next.