@@ -451,6 +451,12 @@ static void ramoops_free_przs(struct ramoops_context *cxt)
451
451
{
452
452
int i ;
453
453
454
+ /* Free pmsg PRZ */
455
+ persistent_ram_free (cxt -> mprz );
456
+
457
+ /* Free console PRZ */
458
+ persistent_ram_free (cxt -> cprz );
459
+
454
460
/* Free dump PRZs */
455
461
if (cxt -> dprzs ) {
456
462
for (i = 0 ; i < cxt -> max_dump_cnt ; i ++ )
@@ -772,12 +778,12 @@ static int ramoops_probe(struct platform_device *pdev)
772
778
dump_mem_sz , cxt -> record_size ,
773
779
& cxt -> max_dump_cnt , 0 , 0 );
774
780
if (err )
775
- goto fail_out ;
781
+ goto fail_init ;
776
782
777
783
err = ramoops_init_prz ("console" , dev , cxt , & cxt -> cprz , & paddr ,
778
784
cxt -> console_size , 0 );
779
785
if (err )
780
- goto fail_init_cprz ;
786
+ goto fail_init ;
781
787
782
788
cxt -> max_ftrace_cnt = (cxt -> flags & RAMOOPS_FLAG_FTRACE_PER_CPU )
783
789
? nr_cpu_ids
@@ -788,12 +794,12 @@ static int ramoops_probe(struct platform_device *pdev)
788
794
(cxt -> flags & RAMOOPS_FLAG_FTRACE_PER_CPU )
789
795
? PRZ_FLAG_NO_LOCK : 0 );
790
796
if (err )
791
- goto fail_init_fprz ;
797
+ goto fail_init ;
792
798
793
799
err = ramoops_init_prz ("pmsg" , dev , cxt , & cxt -> mprz , & paddr ,
794
800
cxt -> pmsg_size , 0 );
795
801
if (err )
796
- goto fail_init_mprz ;
802
+ goto fail_init ;
797
803
798
804
cxt -> pstore .data = cxt ;
799
805
/*
@@ -857,11 +863,7 @@ static int ramoops_probe(struct platform_device *pdev)
857
863
kfree (cxt -> pstore .buf );
858
864
fail_clear :
859
865
cxt -> pstore .bufsize = 0 ;
860
- persistent_ram_free (cxt -> mprz );
861
- fail_init_mprz :
862
- fail_init_fprz :
863
- persistent_ram_free (cxt -> cprz );
864
- fail_init_cprz :
866
+ fail_init :
865
867
ramoops_free_przs (cxt );
866
868
fail_out :
867
869
return err ;
@@ -876,8 +878,6 @@ static int ramoops_remove(struct platform_device *pdev)
876
878
kfree (cxt -> pstore .buf );
877
879
cxt -> pstore .bufsize = 0 ;
878
880
879
- persistent_ram_free (cxt -> mprz );
880
- persistent_ram_free (cxt -> cprz );
881
881
ramoops_free_przs (cxt );
882
882
883
883
return 0 ;
0 commit comments