]> git.baikalelectronics.ru Git - kernel.git/commit
mvpp2: fix pointer check
authorMatteo Croce <mcroce@microsoft.com>
Tue, 7 Jul 2020 13:19:13 +0000 (15:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 Jul 2020 20:03:21 +0000 (13:03 -0700)
commitcef761f033ad89bc317bdc49dd73dac4d2ac153b
tree5b5039830e3a61daa0590688ae25f8069a323470
parent2e307e0aab539884fb3a21d7d45dba93d88f5475
mvpp2: fix pointer check

priv->page_pool is an array, so comparing against it will always return true.
Do a meaningful check by checking priv->page_pool[0] instead.
While at it, clear the page_pool pointers on deallocation, or when an
allocation error happens during init.

Reported-by: Colin Ian King <colin.king@canonical.com>
Fixes: 4485e232f239 ("mvpp2: XDP TX support")
Signed-off-by: Matteo Croce <mcroce@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c