diff mbox

ASoC: Intel: Skylake: Fix uninitialized return

Message ID 1503497232-21345-1-git-send-email-subhransu.s.prusty@intel.com (mailing list archive)
State Accepted
Commit 9149916f1e8c912c585ddebf12a98e99bd81aafe
Headers show

Commit Message

Subhransu S. Prusty Aug. 23, 2017, 2:07 p.m. UTC
On failure to get dsp_ops, dsp_init returns error without assigning ret. ret
is assigned in code path which will never be executed. Fix it.

Fixes: f77d443c4c29 ("ASoC: Intel: Skylake: Fix to free resources for dsp_init failure"
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
---
 sound/soc/intel/skylake/skl-messages.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vinod Koul Aug. 25, 2017, 5:41 a.m. UTC | #1
On Wed, Aug 23, 2017 at 07:37:12PM +0530, Subhransu S. Prusty wrote:
> On failure to get dsp_ops, dsp_init returns error without assigning ret. ret
> is assigned in code path which will never be executed. Fix it.

Acked-By: Vinod Koul <vinod.koul@intel.com>

> Fixes: f77d443c4c29 ("ASoC: Intel: Skylake: Fix to free resources for dsp_init failure"
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> ---
>  sound/soc/intel/skylake/skl-messages.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
> index f0f11f597b21..697d07bc1b5a 100644
> --- a/sound/soc/intel/skylake/skl-messages.c
> +++ b/sound/soc/intel/skylake/skl-messages.c
> @@ -278,8 +278,8 @@ int skl_init_dsp(struct skl *skl)
>  
>  	ops = skl_get_dsp_ops(skl->pci->device);
>  	if (!ops) {
> -		goto unmap_mmio;
>  		ret = -EIO;
> +		goto unmap_mmio;
>  	}
>  
>  	loader_ops = ops->loader_ops();
> -- 
> 1.9.1
>
diff mbox

Patch

diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index f0f11f597b21..697d07bc1b5a 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -278,8 +278,8 @@  int skl_init_dsp(struct skl *skl)
 
 	ops = skl_get_dsp_ops(skl->pci->device);
 	if (!ops) {
-		goto unmap_mmio;
 		ret = -EIO;
+		goto unmap_mmio;
 	}
 
 	loader_ops = ops->loader_ops();