Unverified Commit b1e60a34 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!9359 serial: max3100: Lock port->lock when calling uart_handle_cts_change()

parents c8e93031 0294bb25
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ static int max3100_sr(struct max3100_port *s, u16 tx, u16 *rx)
	return 0;
}

static int max3100_handlerx(struct max3100_port *s, u16 rx)
static int max3100_handlerx_unlocked(struct max3100_port *s, u16 rx)
{
	unsigned int ch, flg, status = 0;
	int ret = 0, cts;
@@ -253,6 +253,17 @@ static int max3100_handlerx(struct max3100_port *s, u16 rx)
	return ret;
}

static int max3100_handlerx(struct max3100_port *s, u16 rx)
{
	unsigned long flags;
	int ret;

	uart_port_lock_irqsave(&s->port, &flags);
	ret = max3100_handlerx_unlocked(s, rx);
	uart_port_unlock_irqrestore(&s->port, flags);
	return ret;
}

static void max3100_work(struct work_struct *w)
{
	struct max3100_port *s = container_of(w, struct max3100_port, work);