[rtems commit] grspw.c: Fix Unchecked return value (CID #1399781)

Joel Sherrill joel at rtems.org
Fri Mar 5 20:19:38 UTC 2021


Module:    rtems
Branch:    master
Commit:    1eaf4e461f3800491040c8d1a51d6bba1ed9eab8
Changeset: http://git.rtems.org/rtems/commit/?id=1eaf4e461f3800491040c8d1a51d6bba1ed9eab8

Author:    Ryan Long <ryan.long at oarcorp.com>
Date:      Mon Mar  1 11:06:48 2021 -0500

grspw.c: Fix Unchecked return value (CID #1399781)

CID 1399781: Unchecked return value in grspw_device_init().

Closes #4259

---

 bsps/shared/grlib/spw/grspw.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/bsps/shared/grlib/spw/grspw.c b/bsps/shared/grlib/spw/grspw.c
index 1b50cc6..32740d4 100644
--- a/bsps/shared/grlib/spw/grspw.c
+++ b/bsps/shared/grlib/spw/grspw.c
@@ -465,6 +465,7 @@ int grspw_device_init(GRSPW_DEV *pDev)
 	struct amba_dev_info *ambadev;
 	struct ambapp_core *pnpinfo;
 	union drvmgr_key_value *value;
+        rtems_status_code status;
 
 	/* Get device information from AMBA PnP information */
 	ambadev = (struct amba_dev_info *)pDev->dev->businfo;
@@ -555,21 +556,23 @@ int grspw_device_init(GRSPW_DEV *pDev)
 		return RTEMS_NO_MEMORY;
 
 	/* Create semaphores */
-	rtems_semaphore_create(
+	status = rtems_semaphore_create(
 		rtems_build_name('T', 'x', 'S', '0' + pDev->minor), 
 		0, 
 		RTEMS_FIFO | RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY | \
 		RTEMS_NO_PRIORITY_CEILING, 
 		0, 
 		&(pDev->txsp));
+        _Assert_Unused_variable_equals(status, RTEMS_SUCCESSFUL);
 
-	rtems_semaphore_create(
+	status = rtems_semaphore_create(
 		rtems_build_name('R', 'x', 'S', '0' + pDev->minor), 
 		0, 
 		RTEMS_FIFO | RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY | \
 		RTEMS_NO_PRIORITY_CEILING, 
 		0, 
 		&(pDev->rxsp));
+        _Assert_Unused_variable_equals(status, RTEMS_SUCCESSFUL);
 
 	grspw_hw_init(pDev);
 



More information about the vc mailing list