mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
msm: adsprpc: Fix error code for invalid ioctl
Change error code returned to ENOTTY for invalid ioctl. Also, limit the number of debug messages printed for non ion buffers based on size. Change-Id: Iabbb7a2482b4b5d00a039e90fe7636eba5ca0447 Acked-by: Deepika Singh <dsi@qti.qualcomm.com> Signed-off-by: Mohammed Nayeem Ur Rahman <mohara@codeaurora.org>
This commit is contained in:
parent
e1bdeb4100
commit
8a580a4265
3 changed files with 14 additions and 11 deletions
|
|
@ -66,6 +66,7 @@
|
|||
#define ADSP_MMAP_ADD_PAGES_LLC 0x3000
|
||||
#define FASTRPC_DMAHANDLE_NOMAP (16)
|
||||
|
||||
#define FASTRPC_ENOSUCH 39
|
||||
#define DEBUGFS_SIZE 3072
|
||||
#define UL_SIZE 25
|
||||
#define PID_SIZE 10
|
||||
|
|
@ -2132,12 +2133,12 @@ static int get_args(uint32_t kernel, struct smq_invoke_ctx *ctx)
|
|||
goto bail;
|
||||
}
|
||||
}
|
||||
ADSPRPC_DEBUG(
|
||||
"copied non ion buffer sc 0x%x pv 0x%llx, mend 0x%llx mstart 0x%llx, len %zu size %zu\n",
|
||||
sc, rpra[i].buf.pv,
|
||||
ctx->overps[oix]->mend,
|
||||
ctx->overps[oix]->mstart,
|
||||
rpra[i].buf.len, map->size);
|
||||
if (len > DEBUG_PRINT_SIZE_LIMIT)
|
||||
ADSPRPC_DEBUG(
|
||||
"copied non ion buffer sc 0x%x pv 0x%llx, mend 0x%llx mstart 0x%llx, len %zu\n",
|
||||
sc, rpra[i].buf.pv,
|
||||
ctx->overps[oix]->mend,
|
||||
ctx->overps[oix]->mstart, len);
|
||||
args = args + mlen;
|
||||
rlen -= mlen;
|
||||
}
|
||||
|
|
@ -2647,7 +2648,7 @@ static int fastrpc_internal_invoke(struct fastrpc_file *fl, uint32_t mode,
|
|||
if (err)
|
||||
goto bail;
|
||||
if (fl->sctx->smmu.faults)
|
||||
err = -EDESTADDRREQ;
|
||||
err = -FASTRPC_ENOSUCH;
|
||||
if (err)
|
||||
goto bail;
|
||||
if (ctx) {
|
||||
|
|
@ -5321,7 +5322,7 @@ static inline int fastrpc_mmap_device_ioctl(struct fastrpc_file *fl,
|
|||
goto bail;
|
||||
break;
|
||||
default:
|
||||
err = -EINVAL;
|
||||
err = -ENOTTY;
|
||||
pr_info("bad ioctl: %d\n", ioctl_num);
|
||||
break;
|
||||
}
|
||||
|
|
@ -5453,7 +5454,7 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int ioctl_num,
|
|||
err = fastrpc_mmap_device_ioctl(fl, ioctl_num, &p, param);
|
||||
break;
|
||||
default:
|
||||
err = -EINVAL;
|
||||
err = -ENOTTY;
|
||||
pr_info("bad ioctl: %d\n", ioctl_num);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ static int compat_get_fastrpc_ioctl_invoke2(
|
|||
break;
|
||||
}
|
||||
default:
|
||||
err = -EBADRQC;
|
||||
err = -ENOTTY;
|
||||
break;
|
||||
}
|
||||
*inva = inv2_user;
|
||||
|
|
@ -983,6 +983,6 @@ long compat_fastrpc_device_ioctl(struct file *filp, unsigned int cmd,
|
|||
case COMPAT_FASTRPC_IOCTL_MUNMAP:
|
||||
return compat_fastrpc_mmap_device_ioctl(filp, cmd, arg);
|
||||
default:
|
||||
return -ENOIOCTLCMD;
|
||||
return -ENOTTY;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,6 +146,8 @@ do {\
|
|||
pr_debug("Debug: adsprpc (%d): %s: %s: " fmt, __LINE__,\
|
||||
current->comm, __func__, ##args)
|
||||
|
||||
#define DEBUG_PRINT_SIZE_LIMIT (512*1024)
|
||||
|
||||
#define remote_arg64_t union remote_arg64
|
||||
|
||||
struct remote_buf64 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue