Patch "usb: aspeed-vhub: Fix refcount leak bug in ast_vhub_init_desc()" has been added to the 5.18-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

    usb: aspeed-vhub: Fix refcount leak bug in ast_vhub_init_desc()

to the 5.18-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:
     usb-aspeed-vhub-fix-refcount-leak-bug-in-ast_vhub_in.patch
and it can be found in the queue-5.18 subdirectory.

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



commit 35daaf8bed1f3b7988160a05e241ae726d2da34a
Author: Liang He <windhl@xxxxxxx>
Date:   Wed Jul 13 20:05:28 2022 +0800

    usb: aspeed-vhub: Fix refcount leak bug in ast_vhub_init_desc()
    
    [ Upstream commit 220fafb4ed04187e9c17be4152da5a7f2ffbdd8c ]
    
    We should call of_node_put() for the reference returned by
    of_get_child_by_name() which has increased the refcount.
    
    Fixes: 30d2617fd7ed ("usb: gadget: aspeed: allow to set usb strings in device tree")
    Signed-off-by: Liang He <windhl@xxxxxxx>
    Link: https://lore.kernel.org/r/20220713120528.368168-1-windhl@xxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/gadget/udc/aspeed-vhub/hub.c b/drivers/usb/gadget/udc/aspeed-vhub/hub.c
index 65cd4e46f031..e2207d014620 100644
--- a/drivers/usb/gadget/udc/aspeed-vhub/hub.c
+++ b/drivers/usb/gadget/udc/aspeed-vhub/hub.c
@@ -1059,8 +1059,10 @@ static int ast_vhub_init_desc(struct ast_vhub *vhub)
 	/* Initialize vhub String Descriptors. */
 	INIT_LIST_HEAD(&vhub->vhub_str_desc);
 	desc_np = of_get_child_by_name(vhub_np, "vhub-strings");
-	if (desc_np)
+	if (desc_np) {
 		ret = ast_vhub_of_parse_str_desc(vhub, desc_np);
+		of_node_put(desc_np);
+	}
 	else
 		ret = ast_vhub_str_alloc_add(vhub, &ast_vhub_strings);
 



[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