File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -372,18 +372,18 @@ static void do_persistent_allow_list(struct callback_head *_cb)
372372 filp_open (KERNEL_SU_ALLOWLIST , O_WRONLY | O_CREAT | O_TRUNC , 0644 );
373373 if (IS_ERR (fp )) {
374374 pr_err ("save_allow_list create file failed: %ld\n" , PTR_ERR (fp ));
375- return ;
375+ goto unlock ;
376376 }
377377
378378 // store magic and version
379379 if (kernel_write (fp , & magic , sizeof (magic ), & off ) != sizeof (magic )) {
380380 pr_err ("save_allow_list write magic failed.\n" );
381- goto exit ;
381+ goto close_file ;
382382 }
383383
384384 if (kernel_write (fp , & version , sizeof (version ), & off ) != sizeof (version )) {
385385 pr_err ("save_allow_list write version failed.\n" );
386- goto exit ;
386+ goto close_file ;
387387 }
388388
389389 list_for_each (pos , & allow_list ) {
@@ -394,8 +394,9 @@ static void do_persistent_allow_list(struct callback_head *_cb)
394394 kernel_write (fp , & p -> profile , sizeof (p -> profile ), & off );
395395 }
396396
397- exit :
397+ close_file :
398398 filp_close (fp , 0 );
399+ unlock :
399400 mutex_unlock (& allowlist_mutex );
400401}
401402
You can’t perform that action at this time.
0 commit comments