Commit 47e5ea82 authored by Anirudh Rayabharam's avatar Anirudh Rayabharam Committed by Lee Jones
Browse files

media: pvrusb2: fix warning in pvr2_i2c_core_done



[ Upstream commit f8194e5e ]

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: default avatar <syzbot+e74a998ca8f1df9cc332@syzkaller.appspotmail.com>
Tested-by: default avatar <syzbot+e74a998ca8f1df9cc332@syzkaller.appspotmail.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarAnirudh Rayabharam <mail@anirudhrb.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: Ic3db8de6359eab617158f1318f76246d761eb495
parent 9db210be
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment