[Prism54-devel] [PATCH] double-free in isl_ioctl.c

Jens Maurer Jens.Maurer@gmx.net
Wed, 07 Jan 2004 23:58:40 +0100


Aurelien wrote:
> replying to myself a second time... because my brain is very slow these days... or at least slower than my fingers...
> 
> I would do the fllowing:
> 
> -if (_op == PIMFOR_OP_ERROR)
> -	islpci_mgt_release(priv, *entry);
> -if (_rvalue || _op == PIMFOR_OP_ERROR)
> +if (_rvalue || _op == PIMFOR_OP_ERROR){
> +	if(*entry)
> +		islpci_mgt_release(priv, *entry);
> 	_rvalue = -EINVAL;
> +}
> 
> because I'm not sure if something got allocated (ie *entry!=0) when _op=PIMFOR_OP_ERROR.

If you like...  I checked in my patch from yesterday (I have CVS write access now),
so go ahead if you feel safer here.

Jens Maurer