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 88 */
99
1010#include <linux/acpi.h>
11+ #include <linux/cleanup.h>
1112#include <linux/export.h>
1213#include <linux/io.h>
1314#include <linux/module.h>
@@ -69,7 +70,6 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
6970{
7071 struct sdw_amd_ctx * ctx ;
7172 struct acpi_device * adev ;
72- struct resource * sdw_res ;
7373 struct acp_sdw_pdata sdw_pdata [2 ];
7474 struct platform_device_info pdevinfo [2 ];
7575 u32 link_mask ;
@@ -104,7 +104,8 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
104104
105105 ctx -> count = count ;
106106 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 );
108109 if (!sdw_res ) {
109110 kfree (ctx );
110111 return NULL ;
@@ -132,7 +133,6 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
132133 if (IS_ERR (ctx -> pdev [index ]))
133134 goto err ;
134135 }
135- kfree (sdw_res );
136136 return ctx ;
137137err :
138138 while (index -- ) {
@@ -142,7 +142,6 @@ static struct sdw_amd_ctx *sdw_amd_probe_controller(struct sdw_amd_res *res)
142142 platform_device_unregister (ctx -> pdev [index ]);
143143 }
144144
145- kfree (sdw_res );
146145 kfree (ctx );
147146 return NULL ;
148147}
You can’t perform that action at this time.
0 commit comments