Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9660d3f8 authored by Jeff Hugo's avatar Jeff Hugo
Browse files

char: msm_smd_pkt: Return correct error code for bad ioctls



Unsupported ioctl commands should return -ENOIOCTLCMD which is translated
to -ENOTTY for userspace.  msm_smd_pkt incorrectly returns -EPERM for bad
ioctls.  Correct the return code for bad ioctls to -ENOIOCTLCMD.

Change-Id: I6d60f4dfc99d4e381ee8105dfb7bd1b9a3ee320b
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent 08a9c39e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2008-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -415,7 +415,7 @@ static long smd_pkt_ioctl(struct file *file, unsigned int cmd,
		break;
	default:
		pr_err("%s: Unrecognized ioctl command %d\n", __func__, cmd);
		ret = -1;
		ret = -ENOIOCTLCMD;
	}
	mutex_unlock(&smd_pkt_devp->ch_lock);