Commit cf9c9445 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Revert "tty: hvc: Fix data abort due to race in hvc_open"

This reverts commit e2bd1dcb


In discussion on the mailing list, it has been determined that this is
not the correct type of fix for this issue.  Revert it so that we can do
this correctly.
Reported-by: default avatarJiri Slaby <>
Reported-by: default avatarGreg Kroah-Hartman <>

Cc: Raghavendra Rao Ananta <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 1cc18584
......@@ -75,8 +75,6 @@ static LIST_HEAD(hvc_structs);
static DEFINE_MUTEX(hvc_structs_mutex);
/* Mutex to serialize hvc_open */
static DEFINE_MUTEX(hvc_open_mutex);
* This value is used to assign a tty->index value to a hvc_struct based
* upon order of exposure via hvc_probe(), when we can not match it to
......@@ -348,24 +346,16 @@ static int hvc_install(struct tty_driver *driver, struct tty_struct *tty)
static int hvc_open(struct tty_struct *tty, struct file * filp)
struct hvc_struct *hp;
struct hvc_struct *hp = tty->driver_data;
unsigned long flags;
int rc = 0;
hp = tty->driver_data;
if (!hp) {
rc = -EIO;
goto out;
spin_lock_irqsave(&hp->port.lock, flags);
/* Check and then increment for fast path open. */
if (hp->port.count++ > 0) {
spin_unlock_irqrestore(&hp->port.lock, flags);
goto out;
return 0;
} /* else count == 0 */
spin_unlock_irqrestore(&hp->port.lock, flags);
......@@ -394,8 +384,6 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
/* Force wakeup of the polling thread */
return rc;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment