Skip to content

Commit

Permalink
Bluetooth: mgmt: Remove unwanted goto statements
Browse files Browse the repository at this point in the history
Remove goto statements that do nothing else than jump to the next line
of code.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
Syam Sidhardhan authored and Gustavo Padovan committed May 9, 2012
1 parent 5c94f37 commit 0c01bc4
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,10 +1247,8 @@ static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)

err = hci_send_cmd(hdev, HCI_OP_WRITE_LE_HOST_SUPPORTED, sizeof(hci_cp),
&hci_cp);
if (err < 0) {
if (err < 0)
mgmt_pending_remove(cmd);
goto unlock;
}

unlock:
hci_dev_unlock(hdev);
Expand Down Expand Up @@ -1300,10 +1298,8 @@ static int add_uuid(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
}

cmd = mgmt_pending_add(sk, MGMT_OP_ADD_UUID, hdev, data, len);
if (!cmd) {
if (!cmd)
err = -ENOMEM;
goto failed;
}

failed:
hci_dev_unlock(hdev);
Expand Down Expand Up @@ -1388,10 +1384,8 @@ static int remove_uuid(struct sock *sk, struct hci_dev *hdev, void *data,
}

cmd = mgmt_pending_add(sk, MGMT_OP_REMOVE_UUID, hdev, data, len);
if (!cmd) {
if (!cmd)
err = -ENOMEM;
goto unlock;
}

unlock:
hci_dev_unlock(hdev);
Expand Down Expand Up @@ -1442,10 +1436,8 @@ static int set_dev_class(struct sock *sk, struct hci_dev *hdev, void *data,
}

cmd = mgmt_pending_add(sk, MGMT_OP_SET_DEV_CLASS, hdev, data, len);
if (!cmd) {
if (!cmd)
err = -ENOMEM;
goto unlock;
}

unlock:
hci_dev_unlock(hdev);
Expand Down

0 comments on commit 0c01bc4

Please sign in to comment.