lkml.org 
[lkml]   [2004]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] inotify: a replacement for dnotify
* 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(&current->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
-
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 14:08    [W:0.051 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site