lkml.org 
[lkml]   [2018]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] proc/sysctl: don't return ENOMEM on lookup when a table is unregistering
On Thu, Dec 13, 2018 at 03:20:52PM -0800, Ivan Delalande wrote:

> @@ -474,7 +474,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
> if (unlikely(head->unregistering)) {
> spin_unlock(&sysctl_lock);
> iput(inode);
> - inode = NULL;
> + inode = ERR_PTR(-ENOENT);
> goto out;
> }

Applied, with one modification: if you look at the target of that goto,
you'll see
out:
return inode;
so this place should be simply
spin_unlock(&sysctl_lock);
iput(inode);
return ERR_PTR(-ENOENT);
}

That way the label becomes unused and goes away.

\
 
 \ /
  Last update: 2018-12-14 02:46    [W:0.031 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site