Skip to content

Commit dbed22f

Browse files
Qiujun Huanggregkh
authored andcommitted
Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl
commit 71811ca upstream. 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> Suggested-by: Hillf Danton <hdanton@sina.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ee11495 commit dbed22f

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • net/bluetooth/rfcomm

‎net/bluetooth/rfcomm/tty.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,8 @@ static int __rfcomm_create_dev(struct sock *sk, void __user *arg)
413413
dlc = rfcomm_dlc_exists(&req.src, &req.dst, req.channel);
414414
if (IS_ERR(dlc))
415415
return PTR_ERR(dlc);
416-
else if (dlc) {
417-
rfcomm_dlc_put(dlc);
416+
if (dlc)
418417
return -EBUSY;
419-
}
420418
dlc = rfcomm_dlc_alloc(GFP_KERNEL);
421419
if (!dlc)
422420
return -ENOMEM;

0 commit comments

Comments
 (0)