File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1269,6 +1269,9 @@ static int ucsi_init(struct ucsi *ucsi)
1269
1269
con -> port = NULL ;
1270
1270
}
1271
1271
1272
+ kfree (ucsi -> connector );
1273
+ ucsi -> connector = NULL ;
1274
+
1272
1275
err_reset :
1273
1276
memset (& ucsi -> cap , 0 , sizeof (ucsi -> cap ));
1274
1277
ucsi_reset_ppm (ucsi );
@@ -1300,7 +1303,8 @@ static void ucsi_resume_work(struct work_struct *work)
1300
1303
1301
1304
int ucsi_resume (struct ucsi * ucsi )
1302
1305
{
1303
- queue_work (system_long_wq , & ucsi -> resume_work );
1306
+ if (ucsi -> connector )
1307
+ queue_work (system_long_wq , & ucsi -> resume_work );
1304
1308
return 0 ;
1305
1309
}
1306
1310
EXPORT_SYMBOL_GPL (ucsi_resume );
@@ -1420,6 +1424,9 @@ void ucsi_unregister(struct ucsi *ucsi)
1420
1424
/* Disable notifications */
1421
1425
ucsi -> ops -> async_write (ucsi , UCSI_CONTROL , & cmd , sizeof (cmd ));
1422
1426
1427
+ if (!ucsi -> connector )
1428
+ return ;
1429
+
1423
1430
for (i = 0 ; i < ucsi -> cap .num_connectors ; i ++ ) {
1424
1431
cancel_work_sync (& ucsi -> connector [i ].work );
1425
1432
ucsi_unregister_partner (& ucsi -> connector [i ]);
You can’t perform that action at this time.
0 commit comments