From 74a31be974dde1d12ed9db131b413c519f8fc429 Mon Sep 17 00:00:00 2001 From: Shirong Zhao Date: Mon, 5 Oct 2026 13:58:25 +0800 Subject: [PATCH] s390/fs3270: Return -ENOTTY for unknown ioctls in fs3270_ioctl() fs3270_ioctl() initializes rc to 0 and its cmd switch has no default branch, so an unrecognized ioctl command returns success without doing anything. Follow the ioctl convention and reject unknown commands with -ENOTTY. [hca@linux.ibm.com: shortened commit description] Signed-off-by: Shirong Zhao Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens --- drivers/s390/char/fs3270.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c index f8e2cc17ac53..25f0a85d92fa 100644 --- a/drivers/s390/char/fs3270.c +++ b/drivers/s390/char/fs3270.c @@ -355,6 +355,9 @@ static long fs3270_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) if (copy_to_user(argp, &iocb, sizeof(struct raw3270_iocb))) rc = -EFAULT; break; + default: + rc = -ENOTTY; + break; } mutex_unlock(&fs3270_mutex); return rc; -- knotmirror 0.0.1