media: pvrusb2: fix null-ptr-deref in class_unregister()
authorKefeng Wang <wangkefeng.wang@huawei.com>
Wed, 5 Jun 2019 13:08:20 +0000 (09:08 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 5 Jun 2019 19:57:46 +0000 (15:57 -0400)
commit6e2980cc68d0dfac1c734fae887754c1cb9904a0
tree2ba41dfd5ac327fb0c9aee6398b2db5cb3c988eb
parent7aac98494d1d932cde053861ce0c12ca5ab3f762
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: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/usb/pvrusb2/pvrusb2-sysfs.c