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/completion.h>
9
+ #include <linux/cleanup.h>
9
10
#include <linux/device.h>
10
11
#include <linux/io.h>
11
12
#include <linux/jiffies.h>
@@ -600,7 +601,6 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
600
601
struct amd_sdw_manager * amd_manager = snd_soc_dai_get_drvdata (dai );
601
602
struct sdw_amd_dai_runtime * dai_runtime ;
602
603
struct sdw_stream_config sconfig ;
603
- struct sdw_port_config * pconfig ;
604
604
int ch , dir ;
605
605
int ret ;
606
606
@@ -623,7 +623,8 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
623
623
sconfig .bps = snd_pcm_format_width (params_format (params ));
624
624
625
625
/* Port configuration */
626
- pconfig = kzalloc (sizeof (* pconfig ), GFP_KERNEL );
626
+ struct sdw_port_config * pconfig __free (kfree ) = kzalloc (sizeof (* pconfig ),
627
+ GFP_KERNEL );
627
628
if (!pconfig )
628
629
return - ENOMEM ;
629
630
@@ -634,8 +635,6 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
634
635
if (ret )
635
636
dev_err (amd_manager -> dev , "add manager to stream failed:%d\n" , ret );
636
637
637
- kfree (pconfig );
638
-
639
638
return ret ;
640
639
}
641
640
You can’t perform that action at this time.
0 commit comments