Re: relay_destroy_buf fix

Mathieu Desnoyers <[email protected]>
Newsgroups gmane.linux.kernel.tracing
Message-ID <20061127220204.GA6329@Krystal>
Hello,

LTTng 0.6.37 is the version which fixes this issue.

Thanks,

Mathieu

* Gunnar Larisch ([email protected]) wrote:
> Hi Mathieu,
> 
> I noticed an oops in function relay_destroy_buf during access of a "buf"
> variable after freeing "buf". The following patch fixes it.
> 
> Gunnar

> diff --git a/kernel/relay.c b/kernel/relay.c
> index 8dab79c..d682a06 100644
> --- a/kernel/relay.c
> +++ b/kernel/relay.c
> @@ -198,9 +198,9 @@ void relay_destroy_buf(struct rchan_buf
>  			__free_page(buf->page_array[i]);
>  		kfree(buf->page_array);
>  	}
> +	chan->buf[buf->cpu] = NULL;
>  	kfree(buf->padding);
>  	kfree(buf);
> -	chan->buf[buf->cpu] = NULL;
>  	kref_put(&chan->kref, relay_destroy_channel);
>  }
>  

OpenPGP public key:              http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint:     8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.