lkml.org 
[lkml]   [2002]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] Serial 2/2

> @@ -1582,10 +1583,10 @@
> ret = -ENOMEM;
> }
>
> - if (ret) {
> - if (res_rsa)
> + if (ret == 0) {
> + if (res_rsa == 0)
> release_resource(res_rsa);
> - if (res)
> + if (res == 0)
> release_resource(res);
> }
> return ret;

definitely not.

if (res_rsa)
release_resource(res_rsa);

will release the resource if we allocated it. your patch calls
release_resource with an argument of NULL, and we'll leak the resource
we allocated.

i'm not sure about the rest of your changes, but this one is definitely
wrong.

--
Revolutions do not require corporate support.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.923 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site