From: Marcel Holtmann <marcel@holtmann.org>
To: Qiujun Huang <hqjagain@gmail.com>
Cc: Johan Hedberg <johan.hedberg@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Bluez mailing list <linux-bluetooth@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bluetooth/rfcomm: fix ODEBUG bug in rfcomm_dev_ioctl
Date: Sun, 8 Mar 2020 09:18:39 +0100 [thread overview]
Message-ID: <449B4F83-8BCD-413C-823B-C7A5554801FB@holtmann.org> (raw)
In-Reply-To: <1583589488-22450-1-git-send-email-hqjagain@gmail.com>
Hi Qiujun,
> Needn't call 'rfcomm_dlc_put' here, because 'rfcomm_dlc_exists' didn't
> increase dlc->refcnt.
>
> Reported-by: syzbot+4496e82090657320efc6@syzkaller.appspotmail.com
> Signed-off-by: Qiujun Huang <hqjagain@gmail.com>
> ---
> net/bluetooth/rfcomm/tty.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
> index 0c7d31c..ea2a1df0 100644
> --- a/net/bluetooth/rfcomm/tty.c
> +++ b/net/bluetooth/rfcomm/tty.c
> @@ -414,7 +414,6 @@ static int __rfcomm_create_dev(struct sock *sk, void __user *arg)
> if (IS_ERR(dlc))
> return PTR_ERR(dlc);
> else if (dlc) {
> - rfcomm_dlc_put(dlc);
> return -EBUSY;
> }
> dlc = rfcomm_dlc_alloc(GFP_KERNEL);
Please see the proposed change from Hillf.
It is better to not bother with the else if here since the if statement will already leave the function.
if (dlc)
return -EBUSY;
Regards
Marcel
next prev parent reply other threads:[~2020-03-08 8:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-07 13:58 Qiujun Huang
2020-03-07 14:04 ` 黄秋钧
2020-03-08 8:18 ` Marcel Holtmann [this message]
2020-03-08 8:27 ` Qiujun Huang
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=449B4F83-8BCD-413C-823B-C7A5554801FB@holtmann.org \
--to=marcel@holtmann.org \
--cc=davem@davemloft.net \
--cc=hqjagain@gmail.com \
--cc=johan.hedberg@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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®