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

Commit a1bc21a0 authored by Patrick Daly's avatar Patrick Daly
Browse files

ion: Fix missing mutex_unlock on error path



Fix a scenario where an ion_buffer attempts to grab
a mutex it already has.

Change-Id: Ie274904ef7b077cdb0a65e72b626dd37320c7e75
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent b98e655c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -364,8 +364,10 @@ static struct sg_table *ion_map_dma_buf(struct dma_buf_attachment *attachment,
					 map_attrs);
	}

	if (count <= 0)
	if (count <= 0) {
		mutex_unlock(&buffer->lock);
		return ERR_PTR(-ENOMEM);
	}

	a->dma_mapped = true;
	mutex_unlock(&buffer->lock);