Patch "media: pvrusb2: fix warning in pvr2_i2c_core_done" has been added to the 5.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

    media: pvrusb2: fix warning in pvr2_i2c_core_done

to the 5.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:
     media-pvrusb2-fix-warning-in-pvr2_i2c_core_done.patch
and it can be found in the queue-5.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 3bcbf762f5dbf4166302cab354aa489722f89558
Author: Anirudh Rayabharam <mail@xxxxxxxxxxxxx>
Date:   Tue May 4 19:08:58 2021 +0200

    media: pvrusb2: fix warning in pvr2_i2c_core_done
    
    [ Upstream commit f8194e5e63fdcb349e8da9eef9e574d5b1d687cb ]
    
    syzbot has reported the following warning in pvr2_i2c_done:
    
            sysfs group 'power' not found for kobject '1-0043'
    
    When the device is disconnected (pvr_hdw_disconnect), the i2c adapter is
    not unregistered along with the USB and v4l2 teardown. As part of the USB
    device disconnect, the sysfs files of the subdevices are also deleted.
    So, by the time pvr_i2c_core_done is called by pvr_context_destroy, the
    sysfs files have been deleted.
    
    To fix this, unregister the i2c adapter too in pvr_hdw_disconnect. Make
    the device deregistration code shared by calling pvr_hdw_disconnect from
    pvr2_hdw_destroy.
    
    Reported-by: syzbot+e74a998ca8f1df9cc332@xxxxxxxxxxxxxxxxxxxxxxxxx
    Tested-by: syzbot+e74a998ca8f1df9cc332@xxxxxxxxxxxxxxxxxxxxxxxxx
    Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Anirudh Rayabharam <mail@xxxxxxxxxxxxx>
    Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx>
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
index f4a727918e35..d38dee1792e4 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
@@ -2676,9 +2676,8 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw)
 		pvr2_stream_destroy(hdw->vid_stream);
 		hdw->vid_stream = NULL;
 	}
-	pvr2_i2c_core_done(hdw);
 	v4l2_device_unregister(&hdw->v4l2_dev);
-	pvr2_hdw_remove_usb_stuff(hdw);
+	pvr2_hdw_disconnect(hdw);
 	mutex_lock(&pvr2_unit_mtx);
 	do {
 		if ((hdw->unit_number >= 0) &&
@@ -2705,6 +2704,7 @@ void pvr2_hdw_disconnect(struct pvr2_hdw *hdw)
 {
 	pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_disconnect(hdw=%p)",hdw);
 	LOCK_TAKE(hdw->big_lock);
+	pvr2_i2c_core_done(hdw);
 	LOCK_TAKE(hdw->ctl_lock);
 	pvr2_hdw_remove_usb_stuff(hdw);
 	LOCK_GIVE(hdw->ctl_lock);



[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