From 79e903bcd908159c172dd1ec8630db5509a43506 Mon Sep 17 00:00:00 2001 From: Rama Krishna Phani A Date: Mon, 13 May 2019 20:46:32 +0530 Subject: [PATCH] soc: qcom: ipc_router_mhi_xprt: Handle error condition Handle error condition and clean up resources in case of failure with mhi driver. Change-Id: I6de1ebe9063bc0cf4492a8334f242bf34e352e70 Signed-off-by: Rama Krishna Phani A --- drivers/soc/qcom/ipc_router_mhi_xprt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/soc/qcom/ipc_router_mhi_xprt.c b/drivers/soc/qcom/ipc_router_mhi_xprt.c index 104053406ea9..9da9d41e2aa6 100644 --- a/drivers/soc/qcom/ipc_router_mhi_xprt.c +++ b/drivers/soc/qcom/ipc_router_mhi_xprt.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2019, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -876,6 +876,12 @@ static int ipc_router_mhi_config_init( spin_lock_init(&mhi_xprtp->rx_addr_map_list_lock); rc = ipc_router_mhi_driver_register(mhi_xprtp, dev); + if (rc < 0) { + IPC_RTR_ERR("%s: mhi registration failed\n", __func__); + destroy_workqueue(mhi_xprtp->wq); + kfree(mhi_xprtp); + }; + return rc; } -- 2.11.0