linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ibmvnic: Potential NULL dereference in clean_one_tx_pool()
@ 2018-03-23 11:36 Dan Carpenter
  2018-03-23 15:06 ` Thomas Falcon
  2018-03-26  1:14 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-03-23 11:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Thomas Falcon
  Cc: John Allen, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, netdev, linuxppc-dev, kernel-janitors

There is an && vs || typo here, which potentially leads to a NULL
dereference.

Fixes: e9e1e97884b7 ("ibmvnic: Update TX pool cleaning routine")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 5632c030811b..0389a7a52152 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -1135,7 +1135,7 @@ static void clean_one_tx_pool(struct ibmvnic_adapter *adapter,
 	u64 tx_entries;
 	int i;
 
-	if (!tx_pool && !tx_pool->tx_buff)
+	if (!tx_pool || !tx_pool->tx_buff)
 		return;
 
 	tx_entries = tx_pool->num_buffers;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-26  1:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23 11:36 [PATCH net-next] ibmvnic: Potential NULL dereference in clean_one_tx_pool() Dan Carpenter
2018-03-23 15:06 ` Thomas Falcon
2018-03-26  1:14 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).