diff mbox series

Bluetooth: MGMT: Fix error report for ADD_EXT_ADV_PARAMS

Message ID 20221021234617.28848-1-inga.stotland@intel.com
State Accepted
Commit 28fd83db215ebc49ebfe4f87b55b40b859b45bfe
Headers show
Series Bluetooth: MGMT: Fix error report for ADD_EXT_ADV_PARAMS | expand

Commit Message

Inga Stotland Oct. 21, 2022, 11:46 p.m. UTC
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.

Signed-off-by: Inga Stotland <inga.stotland@intel.com>
---
 net/bluetooth/mgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luiz Augusto von Dentz Oct. 21, 2022, 11:58 p.m. UTC | #1
Hi Inga,

On Fri, Oct 21, 2022 at 4:50 PM Inga Stotland <inga.stotland@intel.com> wrote:
>
> 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.

Please add the Fixes tag:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-changes

> Signed-off-by: Inga Stotland <inga.stotland@intel.com>
> ---
>  net/bluetooth/mgmt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index a92e7e485feb..0dd30a3beb77 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -8859,7 +8859,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);
> --
> 2.37.3
>
diff mbox series

Patch

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index a92e7e485feb..0dd30a3beb77 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -8859,7 +8859,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);