Patch "RDMA/bnxt_re: Fix to drop reference to the mmap entry in case of error" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    RDMA/bnxt_re: Fix to drop reference to the mmap entry in case of error

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rdma-bnxt_re-fix-to-drop-reference-to-the-mmap-entry.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 33ad93a99c63210609179646a428519cec62e8e9
Author: Kalesh AP <kalesh-anakkur.purayil@xxxxxxxxxxxx>
Date:   Sat Jan 4 11:45:19 2025 +0530

    RDMA/bnxt_re: Fix to drop reference to the mmap entry in case of error
    
    [ Upstream commit c84f0f4f49d81645f49c3269fdcc3b84ce61e795 ]
    
    In the error handling path of bnxt_re_mmap(), driver should invoke
    rdma_user_mmap_entry_put() to free the reference of mmap entry in case
    the error happens after rdma_user_mmap_entry_get was called.
    
    Fixes: ea2224857882 ("RDMA/bnxt_re: Update alloc_page uapi for pacing")
    Reviewed-by: Saravanan Vajravel <saravanan.vajravel@xxxxxxxxxxxx>
    Reviewed-by: Kashyap Desai <kashyap.desai@xxxxxxxxxxxx>
    Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@xxxxxxxxxxxx>
    Signed-off-by: Selvin Xavier <selvin.xavier@xxxxxxxxxxxx>
    Link: https://patch.msgid.link/20250104061519.2540178-1-kalesh-anakkur.purayil@xxxxxxxxxxxx
    Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index 14e434ff51ede..a7067c3c06797 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -4395,9 +4395,10 @@ int bnxt_re_mmap(struct ib_ucontext *ib_uctx, struct vm_area_struct *vma)
 	case BNXT_RE_MMAP_TOGGLE_PAGE:
 		/* Driver doesn't expect write access for user space */
 		if (vma->vm_flags & VM_WRITE)
-			return -EFAULT;
-		ret = vm_insert_page(vma, vma->vm_start,
-				     virt_to_page((void *)bnxt_entry->mem_offset));
+			ret = -EFAULT;
+		else
+			ret = vm_insert_page(vma, vma->vm_start,
+					     virt_to_page((void *)bnxt_entry->mem_offset));
 		break;
 	default:
 		ret = -EINVAL;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux