lkml.org 
[lkml]   [2021]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5.11 241/601] staging: fwserial: fix TIOCSSERIAL implementation
Date
From: Johan Hovold <johan@kernel.org>

[ Upstream commit a7eaaa9d1032e68669bb479496087ba8fc155ab6 ]

TIOCSSERIAL is a horrid, underspecified, legacy interface which for most
serial devices is only useful for setting the close_delay and
closing_wait parameters.

A non-privileged user has only ever been able to set the since long
deprecated ASYNC_SPD flags and trying to change any other *supported*
feature should result in -EPERM being returned. Setting the current
values for any supported features should return success.

Fix the fwserial implementation which was returning -EPERM also for a
privileged user when trying to change certain unsupported parameters,
and instead return success consistently.

Fixes: 7355ba3445f2 ("staging: fwserial: Add TTY-over-Firewire serial driver")
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20210407102334.32361-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/fwserial/fwserial.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 440d11423812..2888b80a2c1a 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -1234,10 +1234,6 @@ static int set_serial_info(struct tty_struct *tty,
struct fwtty_port *port = tty->driver_data;
unsigned int cdelay;

- if (ss->irq != 0 || ss->port != 0 || ss->custom_divisor != 0 ||
- ss->baud_base != 400000000)
- return -EPERM;
-
cdelay = msecs_to_jiffies(ss->close_delay * 10);

mutex_lock(&port->port.mutex);
--
2.30.2


\
 
 \ /
  Last update: 2021-05-12 19:31    [W:1.497 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site