Skip to content

Commit 24556c1

Browse files
Nick Childgregkh
authored andcommitted
ibmvnic: Unmap DMA login rsp buffer on send login fail
commit 411c565 upstream. If the LOGIN CRQ fails to send then we must DMA unmap the response buffer. Previously, if the CRQ failed then the memory was freed without DMA unmapping. Fixes: c98d9cc ("ibmvnic: send_login should check for crq errors") Signed-off-by: Nick Child <nnac123@linux.ibm.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20230809221038.51296-2-nnac123@linux.ibm.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2c5dd88 commit 24556c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4626,11 +4626,14 @@ static int send_login(struct ibmvnic_adapter *adapter)
46264626
if (rc) {
46274627
adapter->login_pending = false;
46284628
netdev_err(adapter->netdev, "Failed to send login, rc=%d\n", rc);
4629-
goto buf_rsp_map_failed;
4629+
goto buf_send_failed;
46304630
}
46314631

46324632
return 0;
46334633

4634+
buf_send_failed:
4635+
dma_unmap_single(dev, rsp_buffer_token, rsp_buffer_size,
4636+
DMA_FROM_DEVICE);
46344637
buf_rsp_map_failed:
46354638
kfree(login_rsp_buffer);
46364639
adapter->login_rsp_buf = NULL;

0 commit comments

Comments
 (0)