drm/nouveau/kms: Fix memory leak in nv50_mstm_del()
authorLyude Paul <lyude@redhat.com>
Tue, 11 Dec 2018 23:56:20 +0000 (18:56 -0500)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 12 Dec 2018 07:00:26 +0000 (17:00 +1000)
Noticed this while working on redoing the reference counting scheme in
the DP MST helpers. Nouveau doesn't attempt to call
drm_dp_mst_topology_mgr_destroy() at all, which leaves it leaking all of
the resources for drm_dp_mst_topology_mgr and it's children mstbs+ports.

Fixes: f479c0ba4a17 ("drm/nouveau/kms/nv50: initial support for DP 1.2 multi-stream")
Signed-off-by: Lyude Paul <lyude@redhat.com>
Cc: <stable@vger.kernel.org> # v4.10+
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/dispnv50/disp.c

index 03e3ce9e6f28bd579e03f50129327cc697790950..b7fc471056ad09b447972eb677dc13794a3680df 100644 (file)
@@ -1264,6 +1264,7 @@ nv50_mstm_del(struct nv50_mstm **pmstm)
 {
        struct nv50_mstm *mstm = *pmstm;
        if (mstm) {
+               drm_dp_mst_topology_mgr_destroy(&mstm->mgr);
                kfree(*pmstm);
                *pmstm = NULL;
        }