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 66 */
77
88#include <linux/completion.h>
9+ #include <linux/cleanup.h>
910#include <linux/device.h>
1011#include <linux/io.h>
1112#include <linux/jiffies.h>
@@ -600,7 +601,6 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
600601 struct amd_sdw_manager * amd_manager = snd_soc_dai_get_drvdata (dai );
601602 struct sdw_amd_dai_runtime * dai_runtime ;
602603 struct sdw_stream_config sconfig ;
603- struct sdw_port_config * pconfig ;
604604 int ch , dir ;
605605 int ret ;
606606
@@ -623,7 +623,8 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
623623 sconfig .bps = snd_pcm_format_width (params_format (params ));
624624
625625 /* Port configuration */
626- pconfig = kzalloc (sizeof (* pconfig ), GFP_KERNEL );
626+ struct sdw_port_config * pconfig __free (kfree ) = kzalloc (sizeof (* pconfig ),
627+ GFP_KERNEL );
627628 if (!pconfig )
628629 return - ENOMEM ;
629630
@@ -634,8 +635,6 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream,
634635 if (ret )
635636 dev_err (amd_manager -> dev , "add manager to stream failed:%d\n" , ret );
636637
637- kfree (pconfig );
638-
639638 return ret ;
640639}
641640
You can’t perform that action at this time.
0 commit comments