Patch "usb: gadget: uvc: fix missing mutex_unlock() if kstrtou8() fails" has been added to the 5.10-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: gadget: uvc: fix missing mutex_unlock() if kstrtou8() fails

to the 5.10-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-gadget-uvc-fix-missing-mutex_unlock-if-kstrtou8-fails.patch
and it can be found in the queue-5.10 subdirectory.

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


>From 7ebb605d2283fb2647b4fa82030307ce00bee436 Mon Sep 17 00:00:00 2001
From: Yang Yingliang <yangyingliang@xxxxxxxxxx>
Date: Mon, 13 Feb 2023 15:09:26 +0800
Subject: usb: gadget: uvc: fix missing mutex_unlock() if kstrtou8() fails

From: Yang Yingliang <yangyingliang@xxxxxxxxxx>

commit 7ebb605d2283fb2647b4fa82030307ce00bee436 upstream.

If kstrtou8() fails, the mutex_unlock() is missed, move kstrtou8()
before mutex_lock() to fix it up.

Fixes: 0525210c9840 ("usb: gadget: uvc: Allow definition of XUs in configfs")
Fixes: b3c839bd8a07 ("usb: gadget: uvc: Make bSourceID read/write")
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20230213070926.776447-1-yangyingliang@xxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/usb/gadget/function/uvc_configfs.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/drivers/usb/gadget/function/uvc_configfs.c
+++ b/drivers/usb/gadget/function/uvc_configfs.c
@@ -546,6 +546,10 @@ static ssize_t uvcg_default_output_b_sou
 	int result;
 	u8 num;
 
+	result = kstrtou8(page, 0, &num);
+	if (result)
+		return result;
+
 	mutex_lock(su_mutex); /* for navigating configfs hierarchy */
 
 	opts_item = group->cg_item.ci_parent->ci_parent->
@@ -553,10 +557,6 @@ static ssize_t uvcg_default_output_b_sou
 	opts = to_f_uvc_opts(opts_item);
 	cd = &opts->uvc_output_terminal;
 
-	result = kstrtou8(page, 0, &num);
-	if (result)
-		return result;
-
 	mutex_lock(&opts->lock);
 	cd->bSourceID = num;
 	mutex_unlock(&opts->lock);


Patches currently in stable-queue which might be from yangyingliang@xxxxxxxxxx are

queue-5.10/wifi-wl3501_cs-don-t-call-kfree_skb-under-spin_lock_.patch
queue-5.10/wifi-ipw2x00-don-t-call-dev_kfree_skb-under-spin_loc.patch
queue-5.10/wifi-libertas-main-don-t-call-kfree_skb-under-spin_l.patch
queue-5.10/wifi-libertas_tf-don-t-call-kfree_skb-under-spin_loc.patch
queue-5.10/wifi-rtlwifi-rtl8821ae-don-t-call-kfree_skb-under-sp.patch
queue-5.10/wifi-libertas-cmdresp-don-t-call-kfree_skb-under-spi.patch
queue-5.10/usb-gadget-uvc-fix-missing-mutex_unlock-if-kstrtou8-fails.patch
queue-5.10/kernel-fail_function-fix-memory-leak-with-using-debu.patch
queue-5.10/wifi-rtl8xxxu-don-t-call-dev_kfree_skb-under-spin_lo.patch
queue-5.10/ubi-fix-possible-null-ptr-deref-in-ubi_free_volume.patch
queue-5.10/mips-vpe-mt-drop-physical_memsize.patch
queue-5.10/wifi-iwlegacy-common-don-t-call-dev_kfree_skb-under-.patch
queue-5.10/wifi-libertas-if_usb-don-t-call-kfree_skb-under-spin.patch
queue-5.10/powercap-fix-possible-name-leak-in-powercap_register.patch
queue-5.10/wifi-rtlwifi-rtl8723be-don-t-call-kfree_skb-under-sp.patch
queue-5.10/wifi-rtlwifi-rtl8188ee-don-t-call-kfree_skb-under-sp.patch
queue-5.10/arm-omap1-call-platform_device_put-in-error-case-in-.patch



[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