From: Greg KH <gregkh@linuxfoundation.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Joel Becker <jlbec@evilplan.org>,
linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
Daniel Rosenberg <drosen@google.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] configfs: Fix config_item refcnt error in __configfs_open_file()
Date: Thu, 11 Mar 2021 12:29:59 +0100 [thread overview]
Message-ID: <YEn/NzUu496YkPJy@kroah.com> (raw)
In-Reply-To: <20210311111625.GA17025@lst.de>
On Thu, Mar 11, 2021 at 12:16:25PM +0100, Christoph Hellwig wrote:
> I've actually just queued up a similar patch from Daiyue Zhang.
>
> > - goto out_put_item;
> > + goto out_put_module;
> >
> > if (type & CONFIGFS_ITEM_BIN_ATTR) {
> > buffer->bin_attr = to_bin_attr(dentry);
> > @@ -391,7 +391,7 @@ static int __configfs_open_file(struct inode *inode, struct file *file, int type
> > /* Grab the module reference for this attribute if we have one */
> > error = -ENODEV;
> > if (!try_module_get(buffer->owner))
> > - goto out_put_item;
> > + goto out_put_module;
> >
> > error = -EACCES;
> > if (!buffer->item->ci_type)
> > @@ -435,8 +435,6 @@ static int __configfs_open_file(struct inode *inode, struct file *file, int type
> >
> > out_put_module:
> > module_put(buffer->owner);
> > -out_put_item:
> > - config_item_put(buffer->item);
> > out_free_buffer:
>
> But the goto labe changes here look incorrect anyway, as they now introduce
> a double put on the module..
Oops, should be one label lower. Daniel must not have checked this on
a system with modules :)
Let me go fix this up...
thanks,
greg k-h
prev parent reply other threads:[~2021-03-11 11:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 11:05 [PATCH] configfs: Fix config_item refcnt error in __configfs_open_file() gregkh
2021-03-11 11:16 ` Christoph Hellwig
2021-03-11 11:29 ` Greg KH [this message]
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=YEn/NzUu496YkPJy@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=drosen@google.com \
--cc=hch@lst.de \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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