Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp803629ybz; Fri, 17 Apr 2020 10:18:32 -0700 (PDT) X-Google-Smtp-Source: APiQypKOY8HcVJtQeJ8qkIIDNMmACLlYdDjaDUZG/M8NfRMHr+IJdPufVt2BDJ3nSnveFX9EGBYt X-Received: by 2002:a05:6402:21d7:: with SMTP id bi23mr3950656edb.176.1587143912538; Fri, 17 Apr 2020 10:18:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587143912; cv=none; d=google.com; s=arc-20160816; b=i8k21L8wjdNpJMuI01aJCoNSVXysSyuzHY8fNB4pgeCcMlmxUnVE+eDpJKvUHDUQw3 XNhl3F0o+E0qVHYw3GBqMRuOt9NtZ81XCB91oB9wHNIFie5azLZiMPoAvQ2DjG3Kfcxg U9OREEOkppXNBPhJ/wGHftPiarGQG7BjPaDEJJt1+fZfN+EO/tnZWAQL5yv+fBMx4yBD t21JasK1wgmRhvRaw8F+ydzeB7n8KVUjc1TlioThD/AtzJxqXQhlyuE8lbGNfUp+MWol rmDF9M5cY5Fp3dhU2pLYbivA8OfbU0omyRaGVpFg7YsdVZFh+ssfKwKo+hBot1L27veN CQcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=WjAevoRtNnA5eQLgcRAeqiJLeblt9WTjZ1CS+lxMnjI=; b=aAC2LPGoJvIrfwZT8U2Asq01wJfeKW+6ZLVB/h9nxiDAI6quxYraqGEbp+Ld6tzjYd 32ljSlypb5oTpq5M6yJ4EvTTRmUVdWIiaTCKxWTZetYecxilu1N7nOh3TDPB+gPdq4xc CkLWM0bnDjSAv/5Ef1ZRRu1n4mFDfRevNTIxsY6HVXSv06EriWZY4aVq4pHU/089EW6z O980Pt6jEMeZ586s+xfeiKN3XEcJzq+iKH/Dcn0XNxjGpuwzVT9szWJ9L8AkOG4Bhbhe soGvT1+FLRN+tIovdovV9dmt5Wki7OJtzVCixGibHUixy7GnNCwzn4AUrPCYstS2WVag QbtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fYLpWUXl; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi3si16802665edb.116.2020.04.17.10.17.46; Fri, 17 Apr 2020 10:18:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fYLpWUXl; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729673AbgDQRQo (ORCPT + 99 others); Fri, 17 Apr 2020 13:16:44 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:36585 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729658AbgDQRQo (ORCPT ); Fri, 17 Apr 2020 13:16:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587143803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=WjAevoRtNnA5eQLgcRAeqiJLeblt9WTjZ1CS+lxMnjI=; b=fYLpWUXlq66k1CtpYD9h8mvlqMNFE/fSSpMb7YlQvyMqPX1Dxw7XwxmPD6FLg+Nbdn958S PmGt3rLm4HlJ5BpMLEsfzG3qK3WuK55ToCIrZT13nyaMXDUJSA8KFvnx0yOyBS3dUJHzBH nsyU7e3HdoIMiGNY0NU5hAZkrvykLic= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-488-nKmmyVq8MCK42vuE7DHaTQ-1; Fri, 17 Apr 2020 13:15:36 -0400 X-MC-Unique: nKmmyVq8MCK42vuE7DHaTQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D0B9801E70; Fri, 17 Apr 2020 17:15:35 +0000 (UTC) Received: from x1.localdomain.com (ovpn-112-195.ams2.redhat.com [10.36.112.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E21560BF7; Fri, 17 Apr 2020 17:15:33 +0000 (UTC) From: Hans de Goede To: Marcel Holtmann , Johan Hedberg Cc: Hans de Goede , linux-bluetooth@vger.kernel.org Subject: [PATCH 1/8] Bluetooth: btbcm: Drop upper nibble version check from btbcm_initialize() Date: Fri, 17 Apr 2020 19:15:25 +0200 Message-Id: <20200417171532.448053-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org btbcm_initialize() must either return an error; or fill the passed in fw_name, otherwise we end up passing uninitialized stack memory to request_firmware(). Since we have a fallback hw_name of "BCM" not having a known version in the subver field does not matter, drop the check so that we always fill the passed in fw_name. Signed-off-by: Hans de Goede --- drivers/bluetooth/btbcm.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c index 1f498f358f60..b9e1fe052148 100644 --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -440,10 +440,6 @@ int btbcm_initialize(struct hci_dev *hdev, char *fw_= name, size_t len, return err; } =20 - /* Upper nibble of rev should be between 0 and 3? */ - if (((rev & 0xf000) >> 12) > 3) - return 0; - bcm_subver_table =3D (hdev->bus =3D=3D HCI_USB) ? bcm_usb_subver_table = : bcm_uart_subver_table; =20 --=20 2.26.0