af-xdp: add missing unlock in error path

CID 1638288: (#1 of 1): Missing unlock (LOCK)
4. missing_unlock: Returning without unlocking xsk_protect.queue_protect.
pull/14856/head
Victor Julien 5 months ago
parent b84ae80146
commit e7c9be07e6

@ -440,6 +440,7 @@ static TmEcode OpenXSKSocket(AFXDPThreadVars *ptv)
if ((ret = xsk_socket__create(&ptv->xsk.xsk, ptv->livedev->dev, ptv->xsk.queue.queue_num,
ptv->umem.umem, &ptv->xsk.rx, &ptv->xsk.tx, &ptv->xsk.cfg))) {
SCLogError("Failed to create socket: %s", strerror(-ret));
SCMutexUnlock(&xsk_protect.queue_protect);
SCReturnInt(TM_ECODE_FAILED);
}
SCLogDebug("bind to %s on queue %u", ptv->iface, ptv->xsk.queue.queue_num);

Loading…
Cancel
Save