<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 11/21/23 23:05, Rafael J. Wysocki
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJZ5v0hxkoeFYVxQ_ZYCMK+0L=7WdBQHRp6ouv+FzahfMrs_eQ@mail.gmail.com"><span
      style="white-space: pre-wrap">
</span>
      <pre class="moz-quote-pre" wrap="">So wouldn't it be better to avoid modifying *value at all if
raw_pci_read() returns an error?
</pre>
    </blockquote>
    <p>Avoiding of modification of <span style="white-space: pre-wrap">*value at all seems better idea to me than setting it to arbitrary initializing value, indeed.</span></p>
    <p><span style="white-space: pre-wrap">In that case, buffer initialization can be ditched, and </span><span
      style="white-space: pre-wrap">*value set only in case of success.</span></p>
    <p><span style="white-space: pre-wrap"></span></p>
    <blockquote type="cite"
cite="mid:CAJZ5v0hxkoeFYVxQ_ZYCMK+0L=7WdBQHRp6ouv+FzahfMrs_eQ@mail.gmail.com">
      <pre class="moz-quote-pre" wrap="">
And if it returns a success, why wouldn't it be trusted?

</pre>
    </blockquote>
    <p>My concern is, that <span style="white-space: pre-wrap">raw_pci_read() wraps platform-specific handlers, that should conform to the next rules:</span></p>
    <p><span style="white-space: pre-wrap">1) in case of success, they must set value32 (or else, uninitialized data would leak to  acpi_os_read_pci_configuration caller);</span></p>
    <p><span style="white-space: pre-wrap">2) they should use passed &value32 only to set it (or else, </span><span
      style="white-space: pre-wrap">uninitialized data would be used/passed somewhere, is it safe?);</span></p>
    <p><span style="white-space: pre-wrap">Is there any way to be sure, that all the existing and future platform-specific pci-read handlers conform? 
</span><span style="white-space: pre-wrap"></span></p>
  </body>
</html>