Skip to content

Commit

Permalink
Bluetooth: MGMT: Fix error report for ADD_EXT_ADV_PARAMS
Browse files Browse the repository at this point in the history
[ Upstream commit 3b1c7c0 ]

When validating the parameter length for MGMT_OP_ADD_EXT_ADV_PARAMS
command, use the correct op code in error status report:
was MGMT_OP_ADD_ADVERTISING, changed to MGMT_OP_ADD_EXT_ADV_PARAMS.

Fixes: 1241057 ("Bluetooth: Break add adv into two mgmt commands")
Signed-off-by: Inga Stotland <inga.stotland@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
inga-s authored and gregkh committed Dec 31, 2022
1 parent 2addf3c commit f7c9de3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bluetooth/mgmt.c
Expand Up @@ -7971,7 +7971,7 @@ static int add_ext_adv_params(struct sock *sk, struct hci_dev *hdev,
* extra parameters we don't know about will be ignored in this request.
*/
if (data_len < MGMT_ADD_EXT_ADV_PARAMS_MIN_SIZE)
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_ADVERTISING,
return mgmt_cmd_status(sk, hdev->id, MGMT_OP_ADD_EXT_ADV_PARAMS,
MGMT_STATUS_INVALID_PARAMS);

flags = __le32_to_cpu(cp->flags);
Expand Down

0 comments on commit f7c9de3

Please sign in to comment.