The 'sub_driver' has already be check, remove BUG_ON() to handle the fault
more gracefully.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
drivers/platform/loongarch/loongson-laptop.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/platform/loongarch/loongson-laptop.c b/drivers/platform/loongarch/loongson-laptop.c
index a9fdfac50f35..8299195a7116 100644
--- a/drivers/platform/loongarch/loongson-laptop.c
+++ b/drivers/platform/loongarch/loongson-laptop.c
@@ -498,8 +498,6 @@ static int __init generic_subdriver_init(struct generic_sub_driver *sub_driver)
{
int ret;
- BUG_ON(!sub_driver);
-
if (!sub_driver || !sub_driver->driver)
return -EINVAL;
--
2.25.1