]> git.baikalelectronics.ru Git - kernel.git/commit
mqprio: fix potential null pointer dereference on opt
authorColin Ian King <colin.king@canonical.com>
Tue, 17 Oct 2017 15:01:30 +0000 (16:01 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Oct 2017 12:13:14 +0000 (13:13 +0100)
commiteabfed04f72eb16bb9e1065f5ab0c5de9c728530
tree9117bf5372fd50adbfc458f7542c98ed5c0338d9
parent7f06b4057e50084743d004f620b80023a5cafc1a
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: 6fb315fb481d ("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