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>] [day] [month] [year] [list]
Message-ID: <BN9PR12MB53242BC46AB8B4A5D67BF657BC069@BN9PR12MB5324.namprd12.prod.outlook.com>
Date:   Thu, 17 Nov 2022 13:30:38 +0000
From:   Varun Prakash <varun@...lsio.com>
To:     Daniil Tatianin <d-tatianin@...dex-team.ru>,
        Mike Christie <michael.christie@...cle.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>
CC:     "Martin K. Petersen" <martin.petersen@...cle.com>,
        Lee Duncan <lduncan@...e.com>,
        Nilesh Javali <njavali@...vell.com>, Wu Bo <wubo40@...wei.com>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "lvc-project@...uxtesting.org" <lvc-project@...uxtesting.org>,
        "yc-core@...dex-team.ru" <yc-core@...dex-team.ru>
Subject: RE: [PATCH v2] scsi/cxgbi/libcxgbi: make sure sg is present before
 calling sg_next()

>>>>> diff --git a/drivers/scsi/cxgbi/libcxgbi.c 
>>>>> b/drivers/scsi/cxgbi/libcxgbi.c index af281e271f88..2ff9810f42a9 
>>>>> 100644
>>>>> --- a/drivers/scsi/cxgbi/libcxgbi.c
>>>>> +++ b/drivers/scsi/cxgbi/libcxgbi.c
>>>>> @@ -1196,8 +1196,7 @@ void cxgbi_ddp_set_one_ppod(struct 
>>>>> cxgbi_pagepod *ppod,
>>>>>          if (offset == len) {
>>>>>            offset = 0;
>>>>> -        sg = sg_next(sg);
>>>>> -        if (sg) {
>>>>> +        if (sg && (sg = sg_next(sg))) {
>>>>>                addr = sg_dma_address(sg);
>>>>>                len = sg_dma_len(sg);
>>>>>            }
>>>>
>>>> Is cxgbit_set_one_ppod the same function but it already has the 
>>>> extra sg check?
>>>
>>> Good catch! Certainly looks that way, albeit with messier indentation.
>>>
>>>> Should it be a libcxgb function in libcxgb_ppm.c?
>>>
>>> That makes sense to me. Should I just move both there?
>> 
>> I think you can move one function with a fix to libcxgb and kill the second one.
>> Name the new function to cxgb_ddp_set_one_ppod then have cxgbi and cxgbt use it.
>
>Yeah, thah's pretty much what I meant. Thank you!

Yes, you can move cxgbit_set_one_ppod() from cxgbit_ddp.c to libcxgb_ppm.c and
rename it to cxgbi_ppm_set_one_ppod() and remove cxgbi_ddp_set_one_ppod()
from libcxgbi.c.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ