ibmvnic: Potential NULL dereference in clean_one_tx_pool()
Subsystems (5)
PATCH 1/1 ibmvnic: Potential NULL dereference in clean_one_tx_pool()
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 <[email protected]>
drivers/net/ethernet/ibm/ibmvnic.c +1 -1
@@ -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;
Quoted 2 lines · Dan Carpenter
There is an && vs || typo here, which potentially leads to a NULL dereference.
Thanks for catching that!
Quoted 18 lines
Fixes e9e1e97884b7 ("ibmvnic: Update TX pool cleaning routine")Signed-off-by Dan Carpenter <[email protected]>drivers/net/ethernet/ibm/ibmvnic.c +1
-1@@ -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;
From: Dan Carpenter <[email protected]>
Date: Fri, 23 Mar 2018 14:36:15 +0300
Quoted 5 lines
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 <[email protected]>
Applied, thanks Dan.