]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ibmvnic: Fix early release of login buffer
authorThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Thu, 22 Feb 2018 00:18:30 +0000 (18:18 -0600)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Feb 2018 19:45:42 +0000 (14:45 -0500)
The login buffer is released before the driver can perform
sanity checks between resources the driver requested and what
firmware will provide. Don't release the login buffer until
the sanity check is performed.

Fixes: 34f0f4e3f488 ("ibmvnic: Fix login buffer memory leaks")
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index 1495cb99f92497075bc44c8ce115b1231a3f406c..1b3cc8bb07050f6856eb4f3e7fe28e4296219d49 100644 (file)
@@ -3760,7 +3760,6 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
 
        dma_unmap_single(dev, adapter->login_buf_token, adapter->login_buf_sz,
                         DMA_BIDIRECTIONAL);
-       release_login_buffer(adapter);
        dma_unmap_single(dev, adapter->login_rsp_buf_token,
                         adapter->login_rsp_buf_sz, DMA_BIDIRECTIONAL);
 
@@ -3791,6 +3790,7 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq,
                ibmvnic_remove(adapter->vdev);
                return -EIO;
        }
+       release_login_buffer(adapter);
        complete(&adapter->init_done);
 
        return 0;