diff options
| author | Amir Levy <alevy@codeaurora.org> | 2016-11-28 12:12:01 +0200 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-11-30 09:57:33 -0800 |
| commit | c07808d8db72d06dec5f79ed91b2684a19ba4e47 (patch) | |
| tree | 7a4be2beda63afaa3655a38f113097449232e61f | |
| parent | d43553d47d6964196c17c7bad0eed1c735a156f2 (diff) | |
msm ipa3: fix blocking faulty IOCTLs
This change prevents blocking IOCTLs with wrong command
number or wrong magic Number. IOCTL handler should first
check that the command is valid and only then wait for
IPA driver initializations to finish.
CRs-Fixed: 1094653
Signed-off-by: Amir Levy <alevy@codeaurora.org>
Change-Id: I578dc96da96f7c10be51eac1f8b3c190e45dcfcf
| -rw-r--r-- | drivers/platform/msm/ipa/ipa_v3/ipa.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa.c b/drivers/platform/msm/ipa/ipa_v3/ipa.c index 8676b35914e2..2101147e7d24 100644 --- a/drivers/platform/msm/ipa/ipa_v3/ipa.c +++ b/drivers/platform/msm/ipa/ipa_v3/ipa.c @@ -624,16 +624,16 @@ static long ipa3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) IPADBG("cmd=%x nr=%d\n", cmd, _IOC_NR(cmd)); - if (!ipa3_is_ready()) { - IPAERR("IPA not ready, waiting for init completion\n"); - wait_for_completion(&ipa3_ctx->init_completion_obj); - } - if (_IOC_TYPE(cmd) != IPA_IOC_MAGIC) return -ENOTTY; if (_IOC_NR(cmd) >= IPA_IOCTL_MAX) return -ENOTTY; + if (!ipa3_is_ready()) { + IPAERR("IPA not ready, waiting for init completion\n"); + wait_for_completion(&ipa3_ctx->init_completion_obj); + } + IPA_ACTIVE_CLIENTS_INC_SIMPLE(); switch (cmd) { |
