From: Chris Wright <chrisw@osdl.org>
To: Robert Love <rml@novell.com>
Cc: linux-kernel@vger.kernel.org, ttb@tentacle.dhs.org
Subject: Re: [patch] inotify: a replacement for dnotify
Date: Tue, 30 Nov 2004 15:03:45 -0800 [thread overview]
Message-ID: <20041130150345.K14339@build.pdx.osdl.net> (raw)
In-Reply-To: <1101854070.4493.52.camel@betsy.boston.ximian.com>; from rml@novell.com on Tue, Nov 30, 2004 at 05:34:30PM -0500
* Robert Love (rml@novell.com) wrote:
> + user = find_user(current->user->uid);
> + if (!user)
> + return -ENOMEM;
Can just be:
get_uid(current->user);
> +
> + if (atomic_read(&user->inotify_devs) >= sysfs_attrib_max_user_devices)
> + return -ENOSPC;
> +
> + atomic_inc(¤t->user->inotify_devs);
> +
> + dev = kmalloc(sizeof(struct inotify_device), GFP_KERNEL);
> + if (!dev)
> + return -ENOMEM;
Looks like these error conditions leak a refcount on the user_struct.
thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net
next prev parent reply other threads:[~2004-11-30 23:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-30 22:34 Robert Love
2004-11-30 23:03 ` Chris Wright [this message]
2004-12-01 8:38 ` Jan Engelhardt
2004-12-01 18:07 ` Chris Wright
2004-12-01 18:48 ` Robert Love
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041130150345.K14339@build.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@novell.com \
--cc=ttb@tentacle.dhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®