File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -2527,7 +2527,7 @@ static void deactivate_labels(void *region)
2527
2527
2528
2528
static int init_active_labels (struct nd_region * nd_region )
2529
2529
{
2530
- int i ;
2530
+ int i , rc = 0 ;
2531
2531
2532
2532
for (i = 0 ; i < nd_region -> ndr_mappings ; i ++ ) {
2533
2533
struct nd_mapping * nd_mapping = & nd_region -> mapping [i ];
@@ -2546,13 +2546,14 @@ static int init_active_labels(struct nd_region *nd_region)
2546
2546
else if (test_bit (NDD_LABELING , & nvdimm -> flags ))
2547
2547
/* fail, labels needed to disambiguate dpa */ ;
2548
2548
else
2549
- return 0 ;
2549
+ continue ;
2550
2550
2551
2551
dev_err (& nd_region -> dev , "%s: is %s, failing probe\n" ,
2552
2552
dev_name (& nd_mapping -> nvdimm -> dev ),
2553
2553
test_bit (NDD_LOCKED , & nvdimm -> flags )
2554
2554
? "locked" : "disabled" );
2555
- return - ENXIO ;
2555
+ rc = - ENXIO ;
2556
+ goto out ;
2556
2557
}
2557
2558
nd_mapping -> ndd = ndd ;
2558
2559
atomic_inc (& nvdimm -> busy );
@@ -2586,13 +2587,17 @@ static int init_active_labels(struct nd_region *nd_region)
2586
2587
break ;
2587
2588
}
2588
2589
2589
- if (i < nd_region -> ndr_mappings ) {
2590
+ if (i < nd_region -> ndr_mappings )
2591
+ rc = - ENOMEM ;
2592
+
2593
+ out :
2594
+ if (rc ) {
2590
2595
deactivate_labels (nd_region );
2591
- return - ENOMEM ;
2596
+ return rc ;
2592
2597
}
2593
2598
2594
2599
return devm_add_action_or_reset (& nd_region -> dev , deactivate_labels ,
2595
- nd_region );
2600
+ nd_region );
2596
2601
}
2597
2602
2598
2603
int nd_region_register_namespaces (struct nd_region * nd_region , int * err )
You can’t perform that action at this time.
0 commit comments