Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1468560

Re: ALSA: compress: Memset timestamp structure to zero.

From Takashi Iwai <tiwai@suse.de>
Newsgroups linux.kernel
Subject Re: ALSA: compress: Memset timestamp structure to zero.
Date 2016-08-23 15:50 +0200
Message-ID <s9kfv-4GF-13@gated-at.bofh.it> (permalink)
References <s9kfv-4GF-15@gated-at.bofh.it> <s9kfv-4GF-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 23 Aug 2016 15:40:37 +0200,
Luis Henriques wrote:
> 
> From: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
> 
> snd_compr_tstamp is initialized using aggregate initialization
> that does not zero out the padded bytes. Initialize timestamp
> structure to zero using memset to avoid this.
> 
> CRs-Fixed: 568717
> Change-Id: I7a7d188705161f06201f1a1f2945bb6acd633d5d
> Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>

Vinod already informed me about this, and we agreed that it doesn't
make any sense.  What does it really fix?


thanks,

Takashi

> ---
>  sound/core/compress_offload.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
> index 2c498488af6c..84aaa07ca853 100644
> --- a/sound/core/compress_offload.c
> +++ b/sound/core/compress_offload.c
> @@ -659,9 +659,10 @@ snd_compr_set_metadata(struct snd_compr_stream *stream, unsigned long arg)
>  static inline int
>  snd_compr_tstamp(struct snd_compr_stream *stream, unsigned long arg)
>  {
> -	struct snd_compr_tstamp tstamp = {0};
> +	struct snd_compr_tstamp tstamp;
>  	int ret;
>  
> +	memset(&tstamp, 0, sizeof(tstamp));
>  	ret = snd_compr_update_tstamp(stream, &tstamp);
>  	if (ret == 0)
>  		ret = copy_to_user((struct snd_compr_tstamp __user *)arg,
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

ALSA: compress: Memset timestamp structure to zero. Luis Henriques <luis.henriques@canonical.com> - 2016-08-23 15:50 +0200
  Re: ALSA: compress: Memset timestamp structure to zero. Takashi Iwai <tiwai@suse.de> - 2016-08-23 15:50 +0200
    Re: ALSA: compress: Memset timestamp structure to zero. Vinod Koul <vinod.koul@intel.com> - 2016-08-23 18:00 +0200

csiph-web