lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d5764fcd8becc0b04373bc1113d2049a@codeaurora.org>
Date:   Tue, 24 Jul 2018 12:26:50 +0530
From:   Balakrishna Godavarthi <bgodavar@...eaurora.org>
To:     Matthias Kaehlcke <mka@...omium.org>
Cc:     marcel@...tmann.org, johan.hedberg@...il.com,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
        linux-bluetooth@...r.kernel.org, thierry.escande@...aro.org,
        rtatiya@...eaurora.org, hemantg@...eaurora.org,
        linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v10 3/7] Bluetooth: btqca: Redefine qca_uart_setup() to
 generic function.

Hi Matthias,

On 2018-07-23 23:10, Matthias Kaehlcke wrote:
> On Fri, Jul 20, 2018 at 07:02:39PM +0530, Balakrishna Godavarthi wrote:
>> Redefinition of qca_uart_setup will help future Qualcomm Bluetooth
>> SoC, to use the same function instead of duplicating the function.
>> Added new arguments soc_type and soc_ver to the functions.
>> 
>> These arguments will help to decide type of firmware files
>> to be loaded into Bluetooth chip.
>> soc_type holds the Bluetooth chip connected to APPS processor.
>> soc_ver holds the Bluetooth chip version.
>> 
>> Signed-off-by: Balakrishna Godavarthi <bgodavar@...eaurora.org>
>> Reviewed-by: Matthias Kaehlcke <mka@...omium.org>
>> ---
>>  drivers/bluetooth/btqca.c   | 20 +++++++-------------
>>  drivers/bluetooth/btqca.h   | 13 +++++++++++--
>>  drivers/bluetooth/hci_qca.c | 10 +++++++++-
>>  3 files changed, 27 insertions(+), 16 deletions(-)
>> 
>> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
>> index c5cf9cab438a..b556710ee1bd 100644
>> --- a/drivers/bluetooth/btqca.c
>> +++ b/drivers/bluetooth/btqca.c
>> @@ -85,6 +85,9 @@ int qca_read_soc_version(struct hci_dev *hdev, u32 
>> *soc_version)
>>  out:
>>  	kfree_skb(skb);
>> 
>> +	if (err < 0 || *soc_version == 0)
>> +		bt_dev_err(hdev, "QCA Failed to get version (%d)", err);
> 
> You also have to set 'err' if soc_version is 0, so the caller can skip
> the check for soc_version == 0
> 
> I'd suggest:
> 
>   // directly after setting soc_version
>   if (*soc_version == 0)
>     err = -EILSEQ; // or should it be a different error code?
> 
>   ...
> 
>   if (err)
>     bt_dev_err(hdev, "QCA Failed to get version (%d)", err);
> 
> You could also limit the error log to the 'if (*soc_version == 0)'
> branch, for all other errors there will already be a more specific log
> entry.
> 

[Bala]: will update.

     if(!err && *soc_version == 0)
         err = -EINVAL; // as soc_version zero is invalid.

    if (err)
       bt_dev_err(hdev, "QCA Failed to get version (%d)", err);

>> +
>>  	return err;
>>  }
> 
> Cheers
> 
> Matthias
-- 
Regards
Balakrishna.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ