mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
msm: mhi_dev: Adding check in open channel API
Adding check for mhi_ctx and mhi_ctx->pdev in mhi_dev_open_channel API which is called by the clients. This prevents the device crash when mhi_dev_open_channel is called in PCIe RC configuration or when it is called when mhi_ctx is not created yet. Change-Id: Ic1737fa1090c06153b0638014f014ec7c1ca2903 Signed-off-by: Sai Chaitanya Kaveti <quic_skaveti@quicinc.com>
This commit is contained in:
parent
3f1349abfc
commit
ea49b496fd
1 changed files with 5 additions and 0 deletions
|
|
@ -3155,6 +3155,11 @@ int mhi_dev_open_channel(uint32_t chan_id,
|
|||
struct mhi_dev_channel *ch;
|
||||
struct platform_device *pdev;
|
||||
|
||||
if (!mhi_ctx || !mhi_ctx->pdev) {
|
||||
mhi_log(MHI_MSG_ERROR, "Invalid open channel call for ch_id:%d\n", chan_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pdev = mhi_ctx->pdev;
|
||||
ch = &mhi_ctx->ch[chan_id];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue