mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
drm/amdkfd: return -ENOTTY for unsupported IOCTLs
[ Upstream commit 57af162bfc8c05332a28c4d458d246cc46d2746d ] Some kfd ioctls may not be available depending on the kernel version the user is running, as such we need to report -ENOTTY so userland can determine the cause of the ioctl failure. Signed-off-by: Geoffrey McRae <geoffrey.mcrae@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0f2fce4b19
commit
3dca940d84
1 changed files with 6 additions and 2 deletions
|
|
@ -1796,8 +1796,10 @@ static long kfd_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
|
|||
unsigned int usize, asize;
|
||||
int retcode = -EINVAL;
|
||||
|
||||
if (nr >= AMDKFD_CORE_IOCTL_COUNT)
|
||||
if (nr >= AMDKFD_CORE_IOCTL_COUNT) {
|
||||
retcode = -ENOTTY;
|
||||
goto err_i1;
|
||||
}
|
||||
|
||||
if ((nr >= AMDKFD_COMMAND_START) && (nr < AMDKFD_COMMAND_END)) {
|
||||
u32 amdkfd_size;
|
||||
|
|
@ -1810,8 +1812,10 @@ static long kfd_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
|
|||
asize = amdkfd_size;
|
||||
|
||||
cmd = ioctl->cmd;
|
||||
} else
|
||||
} else {
|
||||
retcode = -ENOTTY;
|
||||
goto err_i1;
|
||||
}
|
||||
|
||||
dev_dbg(kfd_device, "ioctl cmd 0x%x (#%d), arg 0x%lx\n", cmd, nr, arg);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue