From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A251B1C07 for ; Wed, 28 Dec 2022 16:05:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22374C433D2; Wed, 28 Dec 2022 16:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1672243525; bh=EJmILK6yAOIGNz0S2ddwxsZoVnw0JsuolayKR407KjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0a65SYw04ky/SWGLSJ6zpmALIAXXCSo9Lh6y8MzosyaeaYOnYOCG33xNny+5NPfTx 6oYN68YwIfg8cXOKYfo0ERMy1KbBTh6tjxQPpEkrLStpr0GnAR4MditqbiI91IQgZE 79lUd4nJagh8w8B32mvWFYW5uw3g8G1DJQoTk1R0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Inga Stotland , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.0 0539/1073] Bluetooth: MGMT: Fix error report for ADD_EXT_ADV_PARAMS Date: Wed, 28 Dec 2022 15:35:27 +0100 Message-Id: <20221228144342.695952622@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221228144328.162723588@linuxfoundation.org> References: <20221228144328.162723588@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Inga Stotland [ Upstream commit 3b1c7c00b8c22b3cb79532252c59eb0b287bb86d ] 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: 12410572833a2 ("Bluetooth: Break add adv into two mgmt commands") Signed-off-by: Inga Stotland Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- 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 3d1cd0666968..22bfeb5b2b3b 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -8385,7 +8385,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.35.1