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

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

parents 7a4676b2 d8cecee5
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 status = 0;
	int ret = 0, cts;
@@ -254,6 +254,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);