lkml.org 
[lkml]   [2010]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 1/4] cgroup: implement eventfd-based generic API for notifications
From
On Thu, Jan 7, 2010 at 3:01 AM, Paul Menage <menage@google.com> wrote:
> On Wed, Dec 30, 2009 at 7:57 AM, Kirill A. Shutemov
> <kirill@shutemov.name> wrote:
>> +
>> +       if (!IS_ERR(efile))
>> +               fput(efile);
>
> While this is OK currently, it's a bit fragile. efile starts as NULL,
> and IS_ERR(NULL) is false. So if we jump to fail: before trying to do
> the eventfd_fget() then we'll try to fput(NULL), which will oops. This
> works because we don't currently jump to fail: until after
> eventfd_fget(), but someone could add an extra setup step between the
> kzalloc() and the eventfd_fget() which could fail.

So we need to use IS_ERR_OR_NULL here instread of IS_ERR, don't we?
--
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: 2010-01-07 13:39    [W:0.052 / U:5.872 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site