<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 15/05/2025 17:58, Bruce Richardson
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:20250515165854.1087247-1-bruce.richardson@intel.com">
      <pre wrap="" class="moz-quote-pre">When the power_intel_uncore_autotest unit test is run as an unprivileged
user which cannot init the power library, it crashes the unit test
binary due to calling "rte_power_uncore_exit" after the first test case
(initialization) fails. This crash is due to trying to write to NULL
file handles.

Fix the crash by checking each file handle is non-null before writing to
it and closing it.

Fixes: 60b8a661a957 ("power: add Intel uncore frequency control")
Cc: <a class="moz-txt-link-abbreviated" href="mailto:stable@dpdk.org">stable@dpdk.org</a>

Signed-off-by: Bruce Richardson <a class="moz-txt-link-rfc2396E" href="mailto:bruce.richardson@intel.com"><bruce.richardson@intel.com></a>
---
 drivers/power/intel_uncore/intel_uncore.c | 35 ++++++++++++-----------
 1 file changed, 18 insertions(+), 17 deletions(-)

</pre>
    </blockquote>
    <p><span style="white-space: pre-wrap">Acked-by: Kevin Laatz <a class="moz-txt-link-rfc2396E" href="mailto:kevin.laatz@intel.com"><kevin.laatz@intel.com></a></span></p>
    <p><span style="white-space: pre-wrap">
</span></p>
  </body>
</html>