summaryrefslogtreecommitdiff
path: root/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/pvrusb2/pvrusb2-sysfs.c')
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-sysfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c b/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c
index c5dbd5d96457..3e42e209be37 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c
@@ -792,7 +792,8 @@ 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);
- class_unregister(&clp->class);
+ if (clp)
+ class_unregister(&clp->class);
}