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
This commit is contained in:
parent
d43553d47d
commit
c07808d8db
1 changed files with 5 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue