[patch] Staging: intel_sst: fix memory leak

Harsha, Priya priya.harsha at intel.com
Sun Nov 14 21:35:03 PST 2010


> -----Original Message-----
> From: Dan Carpenter [mailto:error27 at gmail.com]
> Sent: Saturday, November 13, 2010 2:28 PM
> To: Greg Kroah-Hartman
> Cc: Harsha, Priya; Koul, Vinod; Alan Cox; devel at driverdev.osuosl.org;
> kernel-janitors at vger.kernel.org
> Subject: [patch] Staging: intel_sst: fix memory leak
> 
> The original code set "str_info->decode_ibuf" to NULL so the kfree() is
> no-op.
> 
> Signed-off-by: Dan Carpenter <error27 at gmail.com>
> ---
> This is a static checker thing.  I don't have the hardware to test this
> myself so please check it carefully.
> 
> diff --git a/drivers/staging/intel_sst/intel_sst_stream_encoded.c
> b/drivers/staging/intel_sst/intel_sst_stream_encoded.c
> index d4e94f1..09993d6 100644
> --- a/drivers/staging/intel_sst/intel_sst_stream_encoded.c
> +++ b/drivers/staging/intel_sst/intel_sst_stream_encoded.c
> @@ -1270,7 +1270,7 @@ finish:
>  	dbufs->output_bytes_produced = total_output;
>  	str_info->status = str_info->prev;
>  	str_info->prev = STREAM_DECODE;
> -	str_info->decode_ibuf = NULL;
>  	kfree(str_info->decode_ibuf);
> +	str_info->decode_ibuf = NULL;
>  	return retval;
>  }
Acked-by: Harsha Priya <priya.harsha at intel.com>


More information about the devel mailing list