Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp437460lqm; Wed, 1 May 2024 05:35:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgEmkKE4JXPrnx9H509GVDcNoG/iH3i6tyPdszh9jB60KbwnPSmge9GOwIlfXj9hZnNv2OKYORmzLaSgWaPgV6uY7iaM7Sp7dMrR86Ng== X-Google-Smtp-Source: AGHT+IEnwxTnbFiKP3xtzHRTf03Riu/QPORj+uGDgFl448t0acYwDiczrxjxtaZi+mxxUNfdRhi9 X-Received: by 2002:a05:620a:1997:b0:790:9aeb:2968 with SMTP id bm23-20020a05620a199700b007909aeb2968mr2605702qkb.52.1714566940133; Wed, 01 May 2024 05:35:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714566940; cv=pass; d=google.com; s=arc-20160816; b=WkgwnS3fa98iIyFSjO1+RwXYcKZhdNqlg6PbvqiEaX/LaKJ4FEo8haf0rrVIFQ2li3 MHF1tE8cCwIcki4Xsy827Dd1XqxbpHJ6c6tbTxT4y+xe07+eRAhnlqihKv8HD4F91QS+ NJoruoqA9RUUaMvh9qqumPUYl9xqtHGDgKtqB2dcVec/N0ll9405OULrQPTSHjKizkl3 PgV7iKEjEKyKEjXlO4wjVSrFTo1wK9I6gBOXfKw/ketOyk6w6TGy1UKjZeGBbGR5yQmK oeKUmtllFI2GoxrqIZCjnTy0TvInLuS9SzkBRYZVrdTyJruqBtwO++Tbrb9DbvNkRu/J 8Upw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Ty3+HrE9kB8aGd2BmvBk05lyAlT5bK2aoI733g31nFE=; fh=n5hoXCcICd4GmAQfEUaLPJaVS9/1rKrgJl6OqEI3S/s=; b=TMuNfJPA/oLWxvoMpE/za6EKi1aUPIka3B8vBlX3h/YcmkR2D8+KzEv4cObD9V0zvB vZAdDKAqHlYUWKOODE4cJJEgVy+8Yp2cqUEywg011T5McE2oxwQrRy9HERCZkC2vAY9e N8VVELqT6LMqGDmxt/r/7ZG+N+8nLHWS9DPjuKxhMxjMHv0m5m5LqmBuqbUNDsonC/C3 1Bvuh47PDg6g5iI6M31IGUq/80gg82HrYg4CiGOwd6NFTQFnAT7VJm9HSsMn/hNuqegf McpklLE/Vux47zD1JDG3OWEuihoHK/akhTGgR7DE3DoKb+zucyYvFIgYcXqgM47Hh4g2 LYGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DrpxwJis; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g4-20020a05620a218400b0079076da0c7esi21256225qka.38.2024.05.01.05.35.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 05:35:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DrpxwJis; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4224-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D76FD1C21397 for ; Wed, 1 May 2024 12:35:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3ADC886130; Wed, 1 May 2024 12:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DrpxwJis" X-Original-To: linux-bluetooth@vger.kernel.org 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 960041DFF7; Wed, 1 May 2024 12:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; cv=none; b=BO36EmpXfvdDlT91eiJXa8qpZQwTf7eC63jH1vRftCPdLE6fVmUdAwW04PbKKXtb56hzYaPG9yYg191j1W3BWtvelsmEM8XLap1mIS1US4FMQS7xMMBoDzWyCxNmtTvn7cfvT5FDhSXSiILPKuRAU7LMH52gBQp6ms48EQivalI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714566914; c=relaxed/simple; bh=aVCy5Wv4CfQbYy32F82+h1WTcZq2oIhWZtBHkh54KtQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uTq0Wh+4FgZjzB9f04k3yG+SRFMHPWUmB4JucK6U2+cJUTW3IjOizciMuu0+SDoNy+sdVAm3AW9jYu5WJcfZYX8vmWPd9AJWhkXYQQMnmojSa/loDbW3dg0ao/Jx/JxWskO7TQHFUZ8zvHHYpUmYgifMMH/2YVwVno6xq9j6+jA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DrpxwJis; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29B3AC113CC; Wed, 1 May 2024 12:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714566914; bh=aVCy5Wv4CfQbYy32F82+h1WTcZq2oIhWZtBHkh54KtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DrpxwJis1f+ftfpR42MZljNakzzqkkNLgj3PV/jl21no13KLMOpo0APyn9xy7Da/6 1H8j58v26zGajPJCZ+TeJhdMr4y66BR7U2k9aHEML67lY/pKAOtrkHpBIipYzzhIgs su1a1y0XDRO5q1v3a2z893ffk56wu0DQNsYdva/84SKtznm4+2dZ5RE3bjHGXWKrYd pZ0BswXEmtwOBwonX2O0HN1nigV2t2olGknThpzUdiWzJ7ZqP3j1ndU0xEogJx8O0+ jOagorrJqWGE0qZ6GXSeqXcD4uUqiyxO4gU02cQ8Dj4Dlrys+TcoQBJ3R0x0L/o+TG nEsE219PA6rpA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1s29B7-000000001l3-06Gn; Wed, 01 May 2024 14:35:17 +0200 From: Johan Hovold To: Marcel Holtmann , Luiz Augusto von Dentz Cc: Janaki Ramaiah Thota , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 3/5] Bluetooth: qca: drop bogus edl header checks Date: Wed, 1 May 2024 14:34:54 +0200 Message-ID: <20240501123456.6712-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240501123456.6712-1-johan+linaro@kernel.org> References: <20240501123456.6712-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The skb->data pointer is never NULL so drop the bogus sanity checks when initialising the EDL header pointer. Signed-off-by: Johan Hovold --- drivers/bluetooth/btqca.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index 638074992c82..2ba1f21f0320 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -55,11 +55,6 @@ int qca_read_soc_version(struct hci_dev *hdev, struct qca_btsoc_version *ver, } edl = (struct edl_event_hdr *)(skb->data); - if (!edl) { - bt_dev_err(hdev, "QCA TLV with no header"); - err = -EILSEQ; - goto out; - } if (edl->cresp != EDL_CMD_REQ_RES_EVT || edl->rtype != rtype) { @@ -121,11 +116,6 @@ static int qca_read_fw_build_info(struct hci_dev *hdev) } edl = (struct edl_event_hdr *)(skb->data); - if (!edl) { - bt_dev_err(hdev, "QCA read fw build info with no header"); - err = -EILSEQ; - goto out; - } if (edl->cresp != EDL_CMD_REQ_RES_EVT || edl->rtype != EDL_GET_BUILD_INFO_CMD) { @@ -183,11 +173,6 @@ static int qca_send_patch_config_cmd(struct hci_dev *hdev) } edl = (struct edl_event_hdr *)(skb->data); - if (!edl) { - bt_dev_err(hdev, "QCA Patch config with no header"); - err = -EILSEQ; - goto out; - } if (edl->cresp != EDL_PATCH_CONFIG_RES_EVT || edl->rtype != EDL_PATCH_CONFIG_CMD) { bt_dev_err(hdev, "QCA Wrong packet received %d %d", edl->cresp, @@ -502,11 +487,6 @@ static int qca_tlv_send_segment(struct hci_dev *hdev, int seg_size, } edl = (struct edl_event_hdr *)(skb->data); - if (!edl) { - bt_dev_err(hdev, "TLV with no header"); - err = -EILSEQ; - goto out; - } if (edl->cresp != EDL_CMD_REQ_RES_EVT || edl->rtype != rtype) { bt_dev_err(hdev, "QCA TLV with error stat 0x%x rtype 0x%x", -- 2.43.2