From: Tedd Ho-Jeong An <hj.tedd.an@gmail.com>
To: Kiran K <kiran.k@intel.com>, linux-bluetooth@vger.kernel.org
Cc: ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com,
tedd.an@intel.com
Subject: Re: [PATCH v1] Bluetooth: btintel: Fix bdaddress comparison with garbage value
Date: Tue, 05 Oct 2021 21:14:20 -0700 [thread overview]
Message-ID: <cbe1d2ae745ae380d2819877bb07e5cc8ba56c44.camel@gmail.com> (raw)
In-Reply-To: <20211005042613.9946-1-kiran.k@intel.com>
On Tue, 2021-10-05 at 09:56 +0530, Kiran K wrote:
> Intel Read Verision(TLV) data is parsed into a local structure
> variable
> and it contains a field for bd address. Bd address is returned only
> in
> bootloader mode and hence bd address in TLV structure needs to be
> validated
> only if controller is present in boot loader mode.
>
Reviewed-by: Tedd Ho-Jeong An <tedd.an@intel.com>
> Signed-off-by: Kiran K <kiran.k@intel.com>
> ---
> drivers/bluetooth/btintel.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/bluetooth/btintel.c
> b/drivers/bluetooth/btintel.c
> index 9359bff47296..d1703cc99705 100644
> --- a/drivers/bluetooth/btintel.c
> +++ b/drivers/bluetooth/btintel.c
> @@ -2081,14 +2081,16 @@ static int
> btintel_prepare_fw_download_tlv(struct hci_dev *hdev,
> if (ver->img_type == 0x03) {
> btintel_clear_flag(hdev, INTEL_BOOTLOADER);
> btintel_check_bdaddr(hdev);
> - }
> -
> - /* If the OTP has no valid Bluetooth device address, then there
> will
> - * also be no valid address for the operational firmware.
> - */
> - if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) {
> - bt_dev_info(hdev, "No device address configured");
> - set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
> + } else {
> + /*
> + * Check for valid bd address in boot loader mode.
> Device
> + * will be marked as unconfigured if empty bd address
> is
> + * found.
> + */
> + if (!bacmp(&ver->otp_bd_addr, BDADDR_ANY)) {
> + bt_dev_info(hdev, "No device address
> configured");
> + set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev-
> >quirks);
> + }
> }
>
> btintel_get_fw_name_tlv(ver, fwname, sizeof(fwname), "sfi");
> @@ -2466,6 +2468,7 @@ static int btintel_setup_combined(struct
> hci_dev *hdev)
> goto exit_error;
> }
>
> + memset(&ver_tlv, 0, sizeof(ver_tlv));
> /* For TLV type device, parse the tlv data */
> err = btintel_parse_version_tlv(hdev, &ver_tlv, skb);
> if (err) {
next prev parent reply other threads:[~2021-10-06 4:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-05 4:26 [PATCH v1] Bluetooth: btintel: Fix bdaddress comparison with garbage value Kiran K
2021-10-06 4:14 ` Tedd Ho-Jeong An [this message]
2021-10-06 8:51 ` Marcel Holtmann
2021-10-06 17:49 ` Luiz Augusto von Dentz
2021-10-07 6:06 ` K, Kiran
2021-10-12 15:51 ` K, Kiran
2021-10-12 15:56 ` Marcel Holtmann
2021-10-13 7:55 ` K, Kiran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cbe1d2ae745ae380d2819877bb07e5cc8ba56c44.camel@gmail.com \
--to=hj.tedd.an@gmail.com \
--cc=chethan.tumkur.narayan@intel.com \
--cc=kiran.k@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=ravishankar.srivatsa@intel.com \
--cc=tedd.an@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox