File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 8
8
*/
9
9
10
10
#include <linux/acpi.h>
11
+ #include <linux/cleanup.h>
11
12
#include <linux/export.h>
12
13
#include <linux/io.h>
13
14
#include <linux/module.h>
@@ -69,7 +70,6 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
69
70
{
70
71
struct sdw_amd_ctx * ctx ;
71
72
struct acpi_device * adev ;
72
- struct resource * sdw_res ;
73
73
struct acp_sdw_pdata sdw_pdata [2 ];
74
74
struct platform_device_info pdevinfo [2 ];
75
75
u32 link_mask ;
@@ -104,7 +104,8 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
104
104
105
105
ctx -> count = count ;
106
106
ctx -> link_mask = res -> link_mask ;
107
- sdw_res = kzalloc (sizeof (* sdw_res ), GFP_KERNEL );
107
+ struct resource * sdw_res __free (kfree ) = kzalloc (sizeof (* sdw_res ),
108
+ GFP_KERNEL );
108
109
if (!sdw_res ) {
109
110
kfree (ctx );
110
111
return NULL ;
@@ -132,7 +133,6 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
132
133
if (IS_ERR (ctx -> pdev [index ]))
133
134
goto err ;
134
135
}
135
- kfree (sdw_res );
136
136
return ctx ;
137
137
err :
138
138
while (index -- ) {
@@ -142,7 +142,6 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
142
142
platform_device_unregister (ctx -> pdev [index ]);
143
143
}
144
144
145
- kfree (sdw_res );
146
145
kfree (ctx );
147
146
return NULL ;
148
147
}
You can’t perform that action at this time.
0 commit comments