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

Aurelien slts@free.fr
Wed, 7 Jan 2004 23:19:53 +0100


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.

...And justice for all