Skip to content

Commit

Permalink
sound: sound/oss/msnd_pinnacle.c: add vfrees
Browse files Browse the repository at this point in the history
At the point of this error-handling code, HAVE_DSPCODEH may be undefined,
so free INITCODE and PERMCODE as done elsewhere.  A jump and label are
introduced to avoid code duplication.

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
JuliaLawall authored and tiwai committed Apr 10, 2012
1 parent c38f62b commit 156d14d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/oss/msnd_pinnacle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,8 @@ static int __init calibrate_adc(WORD srate)

static int upload_dsp_code(void)
{
int ret = 0;

msnd_outb(HPBLKSEL_0, dev.io + HP_BLKS);
#ifndef HAVE_DSPCODEH
INITCODESIZE = mod_firmware_load(INITCODEFILE, &INITCODE);
Expand All @@ -1312,20 +1314,22 @@ static int upload_dsp_code(void)
memcpy_toio(dev.base, PERMCODE, PERMCODESIZE);
if (msnd_upload_host(&dev, INITCODE, INITCODESIZE) < 0) {
printk(KERN_WARNING LOGNAME ": Error uploading to DSP\n");
return -ENODEV;
ret = -ENODEV;
goto out;
}
#ifdef HAVE_DSPCODEH
printk(KERN_INFO LOGNAME ": DSP firmware uploaded (resident)\n");
#else
printk(KERN_INFO LOGNAME ": DSP firmware uploaded\n");
#endif

out:
#ifndef HAVE_DSPCODEH
vfree(INITCODE);
vfree(PERMCODE);
#endif

return 0;
return ret;
}

#ifdef MSND_CLASSIC
Expand Down

0 comments on commit 156d14d

Please sign in to comment.