forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/media/usb/pvrusb2/pvrusb2-sysfs.c
....@@ -1,17 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 *
3
- *
44 * Copyright (C) 2005 Mike Isely <isely@pobox.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
155 */
166
177 #include <linux/string.h>
....@@ -802,7 +792,8 @@
802792 void pvr2_sysfs_class_destroy(struct pvr2_sysfs_class *clp)
803793 {
804794 pvr2_sysfs_trace("Unregistering pvr2_sysfs_class id=%p", clp);
805
- class_unregister(&clp->class);
795
+ if (clp)
796
+ class_unregister(&clp->class);
806797 }
807798
808799