Patch "RDMA/hfi: Decrease PCI device reference count in error path" has been added to the 4.19-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/hfi: Decrease PCI device reference count in error path

to the 4.19-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-hfi-decrease-pci-device-reference-count-in-erro.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 93713394afeb409824ccaaa5c4490a8bca194f42
Author: Xiongfeng Wang <wangxiongfeng2@xxxxxxxxxx>
Date:   Thu Nov 17 21:15:46 2022 +0800

    RDMA/hfi: Decrease PCI device reference count in error path
    
    [ Upstream commit 9b51d072da1d27e1193e84708201c48e385ad912 ]
    
    pci_get_device() will increase the reference count for the returned
    pci_dev, and also decrease the reference count for the input parameter
    *from* if it is not NULL.
    
    If we break out the loop in node_affinity_init() with 'dev' not NULL, we
    need to call pci_dev_put() to decrease the reference count. Add missing
    pci_dev_put() in error path.
    
    Fixes: c513de490f80 ("IB/hfi1: Invalid NUMA node information can cause a divide by zero")
    Signed-off-by: Xiongfeng Wang <wangxiongfeng2@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221117131546.113280-1-wangxiongfeng2@xxxxxxxxxx
    Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/hw/hfi1/affinity.c b/drivers/infiniband/hw/hfi1/affinity.c
index 01ed0a667928..bb670249bebf 100644
--- a/drivers/infiniband/hw/hfi1/affinity.c
+++ b/drivers/infiniband/hw/hfi1/affinity.c
@@ -217,6 +217,8 @@ int node_affinity_init(void)
 	for (node = 0; node < node_affinity.num_possible_nodes; node++)
 		hfi1_per_node_cntr[node] = 1;
 
+	pci_dev_put(dev);
+
 	return 0;
 }
 



[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