@@ -913,9 +913,9 @@ static int find_sdca_entity_pde(struct device *dev,
913
913
{
914
914
static const int mult_delay = 3 ;
915
915
struct sdca_entity_pde * power = & entity -> pde ;
916
+ u32 * delay_list __free (kfree ) = NULL ;
916
917
struct sdca_pde_delay * delays ;
917
918
int num_delays ;
918
- u32 * delay_list ;
919
919
int i , j ;
920
920
921
921
num_delays = fwnode_property_count_u32 (entity_node ,
@@ -962,8 +962,6 @@ static int find_sdca_entity_pde(struct device *dev,
962
962
power -> num_max_delay = num_delays ;
963
963
power -> max_delay = delays ;
964
964
965
- kfree (delay_list );
966
-
967
965
return 0 ;
968
966
}
969
967
@@ -1022,8 +1020,8 @@ static int find_sdca_entities(struct device *dev,
1022
1020
struct fwnode_handle * function_node ,
1023
1021
struct sdca_function_data * function )
1024
1022
{
1023
+ u32 * entity_list __free (kfree ) = NULL ;
1025
1024
struct sdca_entity * entities ;
1026
- u32 * entity_list ;
1027
1025
int num_entities ;
1028
1026
int i , ret ;
1029
1027
@@ -1054,8 +1052,6 @@ static int find_sdca_entities(struct device *dev,
1054
1052
for (i = 0 ; i < num_entities ; i ++ )
1055
1053
entities [i ].id = entity_list [i ];
1056
1054
1057
- kfree (entity_list );
1058
-
1059
1055
/* now read subproperties */
1060
1056
for (i = 0 ; i < num_entities ; i ++ ) {
1061
1057
char entity_property [SDCA_PROPERTY_LENGTH ];
@@ -1170,8 +1166,8 @@ static int find_sdca_entity_connection_pde(struct device *dev,
1170
1166
struct sdca_entity * entity )
1171
1167
{
1172
1168
struct sdca_entity_pde * power = & entity -> pde ;
1169
+ u32 * managed_list __free (kfree ) = NULL ;
1173
1170
struct sdca_entity * * managed ;
1174
- u32 * managed_list ;
1175
1171
int num_managed ;
1176
1172
int i ;
1177
1173
@@ -1205,15 +1201,12 @@ static int find_sdca_entity_connection_pde(struct device *dev,
1205
1201
if (!managed [i ]) {
1206
1202
dev_err (dev , "%s: failed to find entity with id %#x\n" ,
1207
1203
entity -> label , managed_list [i ]);
1208
- kfree (managed_list );
1209
1204
return - EINVAL ;
1210
1205
}
1211
1206
1212
1207
dev_info (dev , "%s -> %s\n" , managed [i ]-> label , entity -> label );
1213
1208
}
1214
1209
1215
- kfree (managed_list );
1216
-
1217
1210
power -> num_managed = num_managed ;
1218
1211
power -> managed = managed ;
1219
1212
@@ -1453,9 +1446,9 @@ static int find_sdca_clusters(struct device *dev,
1453
1446
struct fwnode_handle * function_node ,
1454
1447
struct sdca_function_data * function )
1455
1448
{
1449
+ u32 * cluster_list __free (kfree ) = NULL ;
1456
1450
struct sdca_cluster * clusters ;
1457
1451
int num_clusters ;
1458
- u32 * cluster_list ;
1459
1452
int i , ret ;
1460
1453
1461
1454
num_clusters = fwnode_property_count_u32 (function_node , "mipi-sdca-cluster-id-list" );
@@ -1484,8 +1477,6 @@ static int find_sdca_clusters(struct device *dev,
1484
1477
for (i = 0 ; i < num_clusters ; i ++ )
1485
1478
clusters [i ].id = cluster_list [i ];
1486
1479
1487
- kfree (cluster_list );
1488
-
1489
1480
/* now read subproperties */
1490
1481
for (i = 0 ; i < num_clusters ; i ++ ) {
1491
1482
char cluster_property [SDCA_PROPERTY_LENGTH ];
0 commit comments