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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <042b7f36-aa38-0840-adc0-08ee52ec1c10@nfschina.com>
Date:   Mon, 13 Nov 2023 14:32:00 +0800
From:   Su Hui <suhui@...china.com>
To:     Jason Yan <yanaijie@...wei.com>, jinpu.wang@...ud.ionos.com,
        jejb@...ux.ibm.com, martin.petersen@...cle.com, nathan@...nel.org,
        ndesaulniers@...gle.com, trix@...hat.com
Cc:     damien.lemoal@...nsource.wdc.com, johannes.thumshirn@....com,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        llvm@...ts.linux.dev, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] scsi: pm8001: return error code if no attached dev

On 2023/11/13 13:56, Jason Yan wrote:
> Hi, Su
>
> On 2023/11/13 13:01, Su Hui wrote:
>> Clang static analyzer complains that value stored to 'res' is never 
>> read.
>> Return the error code when sas_find_attached_phy_id() failed.
>>
>> Fixes: ec64858657a8 ("scsi: pm8001: Use sas_find_attached_phy_id() 
>> instead of open coding it")
>
> This 'Fixes' tag is not right. This commit is only a refactor and did 
> not change the original logic here.
>
Hi, Jason

Thanks for your reply. But I think the logic of this code is changed.

>> Signed-off-by: Su Hui <suhui@...china.com>
>> ---
>>   drivers/scsi/pm8001/pm8001_sas.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/scsi/pm8001/pm8001_sas.c 
>> b/drivers/scsi/pm8001/pm8001_sas.c
>> index a5a31dfa4512..a1f58bfff5c0 100644
>> --- a/drivers/scsi/pm8001/pm8001_sas.c
>> +++ b/drivers/scsi/pm8001/pm8001_sas.c
>> @@ -662,6 +662,8 @@ static int pm8001_dev_found_notify(struct 
>> domain_device *dev)
>>                      SAS_ADDR(dev->sas_addr),
>>                      SAS_ADDR(parent_dev->sas_addr));
>>               res = phy_id;
>> +            pm8001_free_dev(pm8001_device);
>> +            goto found_out;

Before this patch, we won't go to label 'found_out', and will call 
PM8001_CHIP_DISP->reg_dev_req() ....

After this patch, we just free the 'pm8001_device' and return the error 
code.

Or maybe I misunderstand somewhere?

Su Hui

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ