File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -3038,17 +3038,13 @@ static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr)
3038
3038
struct cxl_dax_region * cxlr_dax ;
3039
3039
struct device * dev ;
3040
3040
3041
- down_read (& cxl_region_rwsem );
3042
- if (p -> state != CXL_CONFIG_COMMIT ) {
3043
- cxlr_dax = ERR_PTR (- ENXIO );
3044
- goto out ;
3045
- }
3041
+ guard (rwsem_read )(& cxl_region_rwsem );
3042
+ if (p -> state != CXL_CONFIG_COMMIT )
3043
+ return ERR_PTR (- ENXIO );
3046
3044
3047
3045
cxlr_dax = kzalloc (sizeof (* cxlr_dax ), GFP_KERNEL );
3048
- if (!cxlr_dax ) {
3049
- cxlr_dax = ERR_PTR (- ENOMEM );
3050
- goto out ;
3051
- }
3046
+ if (!cxlr_dax )
3047
+ return ERR_PTR (- ENOMEM );
3052
3048
3053
3049
cxlr_dax -> hpa_range .start = p -> res -> start ;
3054
3050
cxlr_dax -> hpa_range .end = p -> res -> end ;
@@ -3061,8 +3057,6 @@ static struct cxl_dax_region *cxl_dax_region_alloc(struct cxl_region *cxlr)
3061
3057
dev -> parent = & cxlr -> dev ;
3062
3058
dev -> bus = & cxl_bus_type ;
3063
3059
dev -> type = & cxl_dax_region_type ;
3064
- out :
3065
- up_read (& cxl_region_rwsem );
3066
3060
3067
3061
return cxlr_dax ;
3068
3062
}
You can’t perform that action at this time.
0 commit comments