serial: core: return early on unsupported ioctls
authorJohan Hovold <johan@kernel.org>
Wed, 7 Apr 2021 09:52:08 +0000 (11:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:19 +0000 (09:50 +0200)
commit26882a15ed238749a14551cdc855551392fe9f84
treedc4e4511d4b3d19b41afef22c605cfab6fa40e76
parent1d9cde4ddf6cd76aa20e1100c8885b80b65ca78c
serial: core: return early on unsupported ioctls

[ Upstream commit 79c5966cec7b148199386ef9933c31b999379065 ]

Drivers can return -ENOIOCTLCMD when an ioctl is not recognised to tell
the upper layers to continue looking for a handler.

This is not the case for the RS485 and ISO7816 ioctls whose handlers
should return -ENOTTY directly in case a serial driver does not
implement the corresponding methods.

Fixes: a5f276f10ff7 ("serial_core: Handle TIOC[GS]RS485 ioctls.")
Fixes: ad8c0eaa0a41 ("tty/serial_core: add ISO7816 infrastructure")
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210407095208.31838-9-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/serial_core.c