Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b1e08e4 authored by Sathish Ambley's avatar Sathish Ambley
Browse files

msm: ADSPRPC: Fix leak that happens while the list gets empty



When the list that holds the open file handles gets empty, the
node does not get freed causing a leak.

Change-Id: I611387abd27033d4ded63b3bf271162c5d95653d
Acked-by: default avatarChenna Kesava Raju <chennak@qti.qualcomm.com>
Signed-off-by: default avatarSathish Ambley <sathishambley@codeaurora.org>
parent fcfbef4e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1874,8 +1874,10 @@ static void file_free_work_handler(struct work_struct *w)
			break;
		}
		mutex_unlock(&me->flfree_mutex);
		if (freefl)
		if (freefl) {
			fastrpc_file_free(freefl->fl);
			kfree(freefl);
		}
		mutex_lock(&me->flfree_mutex);

		if (hlist_empty(&me->fls)) {
@@ -1885,7 +1887,6 @@ static void file_free_work_handler(struct work_struct *w)
			break;
		}
		mutex_unlock(&me->flfree_mutex);
		kfree(freefl);
	}
	return;
}