Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e2980cc authored by Kefeng Wang's avatar Kefeng Wang Committed by Mauro Carvalho Chehab
Browse files

media: pvrusb2: fix null-ptr-deref in class_unregister()



The class_ptr will be NULL if pvr2_sysfs_class_create() fails
in pvr_init(), when call pvr2_sysfs_class_destroy(), it will
lead to null-ptr-deref, fix it.

Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 7aac9849
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -802,6 +802,7 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void)
void pvr2_sysfs_class_destroy(struct pvr2_sysfs_class *clp)
{
	pvr2_sysfs_trace("Unregistering pvr2_sysfs_class id=%p", clp);
	if (clp)
		class_unregister(&clp->class);
}