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

Commit 1149377e authored by Hemant Kumar's avatar Hemant Kumar
Browse files

mhi: core: Call vfree instead of kfree



mhi channel struct pointer is allocated using vzalloc. This pointer
is freed using kfree, which causes page fault. Fix this issue by
calling vfree.

Change-Id: Ibead85231c5cfd3f2e3f9776fdbbd4a9e4163311
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent e42c5b3a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1299,7 +1299,7 @@ static int of_parse_dt(struct mhi_controller *mhi_cntrl,
	return 0;

error_ev_cfg:
	kfree(mhi_cntrl->mhi_chan);
	vfree(mhi_cntrl->mhi_chan);

	return ret;
}
@@ -1442,7 +1442,7 @@ int of_register_mhi_controller(struct mhi_controller *mhi_cntrl)
	kfree(mhi_cntrl->mhi_cmd);

error_alloc_cmd:
	kfree(mhi_cntrl->mhi_chan);
	vfree(mhi_cntrl->mhi_chan);
	kfree(mhi_cntrl->mhi_event);

	return ret;
@@ -1455,7 +1455,7 @@ void mhi_unregister_mhi_controller(struct mhi_controller *mhi_cntrl)

	kfree(mhi_cntrl->mhi_cmd);
	kfree(mhi_cntrl->mhi_event);
	kfree(mhi_cntrl->mhi_chan);
	vfree(mhi_cntrl->mhi_chan);
	kfree(mhi_cntrl->mhi_tsync);

	device_del(&mhi_dev->dev);