Messages in this thread | | | Date | Tue, 30 Nov 2004 15:03:45 -0800 | From | Chris Wright <> | Subject | Re: [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(¤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 - 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/
| |