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

Commit 359b8975 authored by Nicholas Troast's avatar Nicholas Troast Committed by Ankit Sharma
Browse files

qcom-charger: pmic-voter: destroy only valid votables



Votables that are NULL or have already been destroyed need not be
destroyed again. Return immediately when destorying NULL votables.

CRs-Fixed: 1023141
Change-Id: I8e367dbe7acf72471a5a474f0e2a00a4004fcbfb
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent e6fbc72f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -544,6 +544,9 @@ void destroy_votable(struct votable *votable)
	unsigned long flags;
	int i;

	if (!votable)
		return;

	spin_lock_irqsave(&votable_list_slock, flags);
	list_del(&votable->list);
	spin_unlock_irqrestore(&votable_list_slock, flags);