Skip to content

Commit

Permalink
Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl
Browse files Browse the repository at this point in the history
Needn't call 'rfcomm_dlc_put' here, because 'rfcomm_dlc_exists' didn't
increase dlc->refcnt.

Reported-by: [email protected]
Signed-off-by: Qiujun Huang <[email protected]>
Suggested-by: Hillf Danton <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
  • Loading branch information
Qiujun Huang authored and holtmann committed Mar 8, 2020
1 parent 4be5ca6 commit 71811ca
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/bluetooth/rfcomm/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,8 @@ static int __rfcomm_create_dev(struct sock *sk, void __user *arg)
dlc = rfcomm_dlc_exists(&req.src, &req.dst, req.channel);
if (IS_ERR(dlc))
return PTR_ERR(dlc);
else if (dlc) {
rfcomm_dlc_put(dlc);
if (dlc)
return -EBUSY;
}
dlc = rfcomm_dlc_alloc(GFP_KERNEL);
if (!dlc)
return -ENOMEM;
Expand Down

0 comments on commit 71811ca

Please sign in to comment.