summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiddharth Vadapalli <s-vadapalli@ti.com>2024-03-06 21:55:57 +0530
committerPraneeth Bajjuri <praneeth@ti.com>2024-03-07 11:45:56 -0600
commit5e8ede26099d335c192f852b220b7b118c451231 (patch)
treece77802db08f2b5b6d99d01a0c6375059629807f
parent1fe73482c92430477284c28ea412072ffb3c1d9f (diff)
net: ethernet: ti: cpsw-proxy-client: Fix channel validity check in detach
In the "cpsw_proxy_client_detach()" function, the validity of the TX and RX DMA Channels is supposed to be checked in order to notify EthFw that they are being released and no longer used. However, the existing implementation incorrectly validates the address of the "is_valid" member of the TX and RX channel structures rather than its value. Fix this. Fixes: 5f1b32f6bd1b ("net: ethernet: ti: cpsw-proxy-client: Switch to ATTACH Request") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Francesco Dolcini <francesco@dolcini.it> Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
-rw-r--r--drivers/net/ethernet/ti/cpsw-proxy-client.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ti/cpsw-proxy-client.c b/drivers/net/ethernet/ti/cpsw-proxy-client.c
index bda48cbb7c4d..11858f955004 100644
--- a/drivers/net/ethernet/ti/cpsw-proxy-client.c
+++ b/drivers/net/ethernet/ti/cpsw-proxy-client.c
@@ -1750,8 +1750,7 @@ static void cpsw_proxy_client_detach(struct cpsw_proxy_common *common)
/* Free TX DMA Channel */
for (j = 0; j < virt_port->num_tx_chan; j++) {
- if (&virt_port->virt_port_tx_chan &&
- &virt_port->virt_port_tx_chan->is_valid) {
+ if (virt_port->virt_port_tx_chan->is_valid) {
virt_port->curr_tx_chan_idx = j;
ret = cpsw_proxy_client_send_request(common, virt_port,
virt_port->virt_port_token,
@@ -1767,8 +1766,7 @@ static void cpsw_proxy_client_detach(struct cpsw_proxy_common *common)
/* Free RX DMA Flow */
for (j = 0; j < virt_port->num_rx_chan; j++) {
- if (&virt_port->virt_port_rx_chan &&
- &virt_port->virt_port_rx_chan->is_valid) {
+ if (virt_port->virt_port_rx_chan->is_valid) {
virt_port->curr_rx_chan_idx = j;
ret = cpsw_proxy_client_send_request(common, virt_port,
virt_port->virt_port_token,