From 0e0ab81ff9474cffd5e60a8ee741840eac5d737b Mon Sep 17 00:00:00 2001 From: boxi Date: Thu, 6 May 2021 11:09:04 +0800 Subject: [PATCH] fix: Correctly handle the return value of LOS_EventRead in QuickstartListen. Correctly handle the return value of LOS_EventRead in QuickstartListen. Close #I3PSLZ Change-Id: I7b9ab9aa0542b6072dcbe8fa78924125b95c6434 --- drivers/char/quickstart/src/quickstart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/quickstart/src/quickstart.c b/drivers/char/quickstart/src/quickstart.c index 2c023402..22451f87 100644 --- a/drivers/char/quickstart/src/quickstart.c +++ b/drivers/char/quickstart/src/quickstart.c @@ -72,7 +72,7 @@ static int QuickstartListen(unsigned long arg) /* 16:low 16 bits for eventMask, high 16 bits for pid */ unsigned int mask = (listenMask.pid << 16) | listenMask.events; int ret = LOS_EventRead((PEVENT_CB_S)&g_qsEvent, mask, LOS_WAITMODE_AND | LOS_WAITMODE_CLR, LOS_WAIT_FOREVER); - if (ret != 0) { + if (ret != mask) { PRINT_ERR("%s,%d:0x%x\n", __FUNCTION__, __LINE__, ret); ret = -EINVAL; }