]> git.baikalelectronics.ru Git - kernel.git/commit
ionic: catch NULL pointer issue on reconfig
authorBrett Creeley <brett@pensando.io>
Mon, 17 Oct 2022 23:31:23 +0000 (16:31 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 19 Oct 2022 02:19:31 +0000 (19:19 -0700)
commitee36dc00ee6387e0c2f53f1f44ceb29d74c9ed2a
tree83a61b2957c1acde64372aefcfc9c6f923efa3c6
parentd420d4541d20fb1c07c1758c1e8e50bc9a927c78
ionic: catch NULL pointer issue on reconfig

It's possible that the driver will dereference a qcq that doesn't exist
when calling ionic_reconfigure_queues(), which causes a page fault BUG.

If a reduction in the number of queues is followed by a different
reconfig such as changing the ring size, the driver can hit a NULL
pointer when trying to clean up non-existent queues.

Fix this by checking to make sure both the qcqs array and qcq entry
exists bofore trying to use and free the entry.

Fixes: 1845d6e81c61 ("ionic: change queue count with no reset")
Signed-off-by: Brett Creeley <brett@pensando.io>
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Link: https://lore.kernel.org/r/20221017233123.15869-1-snelson@pensando.io
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_lif.c