mqprio: fix potential null pointer dereference on opt
commit22ce97fe49b5522e0f97b7c2282ed71a1abd7410
authorColin Ian King <colin.king@canonical.com>
Tue, 17 Oct 2017 15:01:30 +0000 (17 16:01 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Oct 2017 12:13:14 +0000 (19 13:13 +0100)
tree9117bf5372fd50adbfc458f7542c98ed5c0338d9
parentfa31f0c98d64212b2b2b4a1e6d887208b6acb2d9
mqprio: fix potential null pointer dereference on opt

The pointer opt has a null check however before for this check opt is
dereferenced when len is initialized, hence we potentially have a null
pointer deference on opt.  Avoid this by checking for a null opt before
dereferencing it.

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

Fixes: 4e8b86c06269 ("mqprio: Introduce new hardware offload mode and shaper in mqprio")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_mqprio.c