Skip to contentSkip to conversation

staging/rtl8188eu/core/rtw_cmd: Fixes semaphore locking

PATCH In review Lidza Louina 2 participants 2 messages Aug 9, 2016 – Aug 21, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging/rtl8188eu/core/rtw_cmd: Fixes semaphore locking

The code did not lock the &pcmdpriv->terminate_cmdthread_sema before using it. The code had an up() where a down() should've been. This patch fixes that.

---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/core/rtw_cmd.c +0 -0
index 7748523..16f0b19 100644
@@ -162,7 +162,7 @@ int rtw_cmd_thread(void *context)

  allow_signal(SIGTERM);

  pcmdpriv->cmdthd_running = true;
- up(&pcmdpriv->terminate_cmdthread_sema);
+ down(&pcmdpriv->terminate_cmdthread_sema);

  RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n"));
--
2.7.4

#1 lore raw
Quoted 18 lines · Lidza Louina

The code did not lock the &pcmdpriv->terminate_cmdthread_sema before using it. The code had an up() where a down() should've been. This patch fixes that.

---
 drivers/staging/rtl8188eu/core/rtw_cmd.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/core/rtw_cmd.c +0 -0
index 7748523..16f0b19 100644
@@ -162,7 +162,7 @@ int rtw_cmd_thread(void *context)
  	allow_signal(SIGTERM);


  pcmdpriv->cmdthd_running = true;

drivers/staging/rtl8188eu/core/rtw_cmd.c +1 -1
-	up(&pcmdpriv->terminate_cmdthread_sema);
+	down(&pcmdpriv->terminate_cmdthread_sema);
Quoted 5 lines


  RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("start r871x rtw_cmd_thread !!!!\n"));
--
2.7.4

This path is corrupted somehow and doesn't apply at all :(

Can you see what went wrong with your email client and try again?

thanks,

greg k-h