<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Patch] Linux mutex leak in drm_dp_get_mst_branch"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=92480">92480</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Patch] Linux mutex leak in drm_dp_get_mst_branch
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DRI
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>General
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dri-devel@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>adam_richter2004@yahoo.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I believe I have found a mutex leak in drm_dp_get_mst_branch_device() in
linux/drivers/gpu/drm/drm_dp_mst_topology.c in kernels 4.2-rc1 through the
current version, 4.3-rc5, where the function can take an error exit without
doing mutex_unlock(&mgr_lock).  I have attached a proposed patch.

Unfortunately, since I made the patch, I have not been able to trigger the
error branch that the patch fixes, but I did find the bug by observing that
error branch executing and printing an error message that I believe is unique
to that branch ("*ERROR* failed to lookup MSTB"):

[   36.944273] [drm:gen8_irq_handler [i915]] *ERROR* The master control
interrupt lied (SDE)!
[   74.576811] [drm:drm_dp_get_mst_branch_device [drm_kms_helper]] *ERROR*
failed to lookup MSTB with lct 2, rad 10
[   74.587704] BUG: workqueue leaked lock or atomic: kworker/u8:0/0x00000000/6
[   74.587704]      last function: i915_digport_work_func [i915]
[   74.655752] [drm:gen8_irq_handler [i915]] *ERROR* The master control
interrupt lied (SDE)!

I think this patch is also arguably an infinitesimal improvement in that it
depends less on the optimizer, by reducing two references to port->mstb to one.

Anyhow, if the patch looks good, I would be delighted to if the appropriate
person (Dave?) would integrate it for submission upstream.

Thanks in advance for any feedback on this.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>