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 6
6
*/
7
7
8
8
#include <linux/acpi.h>
9
+ #include <linux/cleanup.h>
9
10
#include <linux/device.h>
10
11
#include <linux/soundwire/sdw_registers.h>
11
12
#include <linux/soundwire/sdw.h>
@@ -310,7 +311,6 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
310
311
struct sdw_cdns_dai_runtime * dai_runtime ;
311
312
struct sdw_cdns_pdi * pdi ;
312
313
struct sdw_stream_config sconfig ;
313
- struct sdw_port_config * pconfig ;
314
314
int ch , dir ;
315
315
int ret ;
316
316
@@ -357,7 +357,8 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
357
357
sconfig .bps = snd_pcm_format_width (params_format (params ));
358
358
359
359
/* Port configuration */
360
- pconfig = kzalloc (sizeof (* pconfig ), GFP_KERNEL );
360
+ struct sdw_port_config * pconfig __free (kfree ) = kzalloc (sizeof (* pconfig ),
361
+ GFP_KERNEL );
361
362
if (!pconfig )
362
363
return - ENOMEM ;
363
364
@@ -369,8 +370,6 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
369
370
if (ret )
370
371
dev_err (cdns -> dev , "add master to stream failed:%d\n" , ret );
371
372
372
- kfree (pconfig );
373
-
374
373
return ret ;
375
374
}
376
375
You can’t perform that action at this time.
0 commit comments