From 0698f576d98ed1c4131d419c40019090f3ae06d1 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 3 Oct 2018 09:51:52 +0200 Subject: ipcpd: Fix bad lock in Ethernet IPCP An unlock was called twice instead of a lock/unlock sequence, causing a data race. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- src/ipcpd/eth/eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ipcpd/eth/eth.c') diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c index af34f68e..9456f4cb 100644 --- a/src/ipcpd/eth/eth.c +++ b/src/ipcpd/eth/eth.c @@ -905,8 +905,8 @@ static void * eth_ipcp_sdu_reader(void * o) memcpy(frame->buf, &e_frame->payload, length); memcpy(frame->r_addr, e_frame->src_hwaddr, MAC_SIZE); - pthread_mutex_unlock(ð_data.mgmt_lock); + pthread_mutex_lock(ð_data.mgmt_lock); list_add(&frame->next, ð_data.mgmt_frames); pthread_cond_signal(ð_data.mgmt_cond); pthread_mutex_unlock(ð_data.mgmt_lock); -- cgit v1.2.3