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

Commit 9b00ffb5 authored by Alok Chauhan's avatar Alok Chauhan Committed by Gerrit - the friendly Code Review server
Browse files

serial: msm_geni_serial: use correct API to free memory



Uart driver uses devm* callback to allocate memory but
uses non devm* callback to free the same allocated memory.
This leads to memory leak.

Use the right callback to free memory.

Change-Id: Ia80603d09bf7a59fc2e0467ca33df0a618eabe4e
Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent 8f24df85
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1635,7 +1635,7 @@ static int msm_geni_serial_port_setup(struct uart_port *uport)
		msm_port->rx_buf = devm_kzalloc(uport->dev, DMA_RX_BUF_SIZE,
								GFP_KERNEL);
		if (!msm_port->rx_buf) {
			kfree(msm_port->rx_fifo);
			devm_kfree(uport->dev, msm_port->rx_fifo);
			msm_port->rx_fifo = NULL;
			ret = -ENOMEM;
			goto exit_portsetup;