Thread (7 messages) 7 messages, 2 authors, 2025-10-30

Re: [PATCH v2 2/2] net: io_uring/zcrx: call netdev_queue_get_dma_dev() under instance lock

From: David Wei <hidden>
Date: 2025-10-30 01:09:44
Also in: io-uring

On 2025-10-29 16:54, Jakub Kicinski wrote:
On Wed, 29 Oct 2025 16:16:54 -0700 David Wei wrote:
quoted
+	ifq->netdev = netdev_get_by_index_lock(current->nsproxy->net_ns, reg.if_idx);
  	if (!ifq->netdev) {
  		ret = -ENODEV;
-		goto err;
+		goto netdev_unlock;
  	}
  
  	ifq->dev = netdev_queue_get_dma_dev(ifq->netdev, reg.if_rxq);
  	if (!ifq->dev) {
  		ret = -EOPNOTSUPP;
-		goto err;
+		goto netdev_unlock;
  	}
+	netdev_hold(ifq->netdev, &ifq->netdev_tracker, GFP_KERNEL);
  	get_device(ifq->dev);
  
  	ret = io_zcrx_create_area(ifq, &area);
  	if (ret)
-		goto err;
+		goto netdev_unlock;
Without looking at larger context this looks sus.
You're jumping to the same label before and after you took the ref on
the netdev..
Sorry you're right, and actually io_zcrx_ifq_free() does netdev_put()
unconditionally. I'll correct this in v3.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help