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

Commit e6b7957e authored by Abinaya P's avatar Abinaya P Committed by Gerrit - the friendly Code Review server
Browse files

drivers: net: can: free allocated memory in k61_spi_transaction function



When multiple CAN frames are sent and received, kernel encounters out of
memory issue as the memory allocated in k61_spi_transaction_function is not
deallocated. Hence, free the allocated memory to avoid memory leak.

CRs-Fixed: 2069680
Change-Id: Ic99a5e93f763dcdad41a1d3d418ff774189e0252
Signed-off-by: default avatarAbinaya P <abinayap@codeaurora.org>
parent e8800dc9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -313,8 +313,11 @@ static int k61_do_spi_transaction(struct k61_can *priv_data)
	ret = spi_sync(spi, msg);
	LOGDI("spi_sync ret %d\n", ret);

	if (ret == 0)
	if (ret == 0) {
		devm_kfree(&spi->dev, msg);
		devm_kfree(&spi->dev, xfer);
		k61_process_rx(priv_data, priv_data->rx_buf);
	}
	return ret;
}