Re: [PATCH] ALSA: hda - Fix memory leak on snd_hdac_device_init error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 09, 2017 at 08:57:51AM +0530, Guneshwor Singh wrote:
> From: "Subhransu S. Prusty" <subhransu.s.prusty@xxxxxxxxx>
> 
> Free codec vendor name on snd_hdac_device_init error.
> 
> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@xxxxxxxxx>
> Signed-off-by: Guneshwor Singh <guneshwor.o.singh@xxxxxxxxx>
> ---
>  sound/hda/hdac_device.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
> index 19deb306facb..467b949544e2 100644
> --- a/sound/hda/hdac_device.c
> +++ b/sound/hda/hdac_device.c
> @@ -111,6 +111,8 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus,
>  	return 0;
>  
>   error:
> +	kfree(codec->vendor_name);

Sorry I dont think this is right.

The vendor name is freed in the snd_hdac_device_exit()

We drop the reference here and release method would be called to
free up the resources.

>  	put_device(&codec->dev);
>  	return err;
>  }
> -- 
> 2.15.0
> 

-- 
~Vinod
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux