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: <CANk1AXQ_nrXUqOdqUFkRYRz_arEg_7YAhZrp2z3-5SbmWOSmWQ@mail.gmail.com>
Date:   Tue, 23 May 2017 10:25:19 -0500
From:   Alan Tull <atull@...nel.org>
To:     "Li, Yi" <yi1.li@...ux.intel.com>
Cc:     mcgrof@...nel.org, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        wagi@...om.org, David Woodhouse <dwmw2@...radead.org>,
        rafal@...ecki.pl, arend.vanspriel@...adcom.com, rjw@...ysocki.net,
        Moritz Fischer <moritz.fischer@...us.com>, pmladek@...e.com,
        johannes.berg@...el.com, emmanuel.grumbach@...el.com,
        Luca Coelho <luciano.coelho@...el.com>, kvalo@...eaurora.org,
        luto@...nel.org, Takahiro Akashi <takahiro.akashi@...aro.org>,
        dhowells@...hat.com, pjones@...hat.com,
        linux-kernel <linux-kernel@...r.kernel.org>,
        linux-fpga@...r.kernel.org
Subject: Re: [PATCHv2 3/3] fpga_mgr: Add streaming support through the new
 driver_data API

On Tue, May 23, 2017 at 10:21 AM, Alan Tull <atull@...nel.org> wrote:

>>>> +
>>>> +       mgr->state = FPGA_MGR_STATE_FIRMWARE_REQ;
>>>> +       while (length > 0) {
>>>
>>> This could be "do { ... } while ((params.fw_size >= FIRMWARE_CHUNK_SZ)
>>> && (length > 0));" since that's what it's really doing.
>>
>> Yes, this is better, thanks.
>>
>>>
>>>> +               ret = driver_data_request_sync(image_name, &req_params,
>>>> dev);
>>>> +               if (ret) {
>>>> +                       dev_err(dev, "Error reading firmware %d\n", ret);
>>>> +                       mgr->state = FPGA_MGR_STATE_FIRMWARE_REQ_ERR;
>
> Also need:  kfree(buf);
>
>>>> +                       return ret;

Or this could be a break instead of a return.

>>>> +               }
>>>> +
>>>> +               length -= params.fw_size;
>>>> +               params.offset += params.fw_size;
>>>> +               if (params.fw_size < SZ_4K)
>>>> +                       break;
>>>> +       }
>>>> +
>>>> +       kfree(buf);
>>>
>>> Please skip a line before return.
>>>
>>>> +       return ret;
>>>> +}
>>>> +EXPORT_SYMBOL_GPL(fpga_mgr_firmware_stream);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ