[rtems commit] gr_rasta_spw_router.c: Fix Unchecked return value from library (CID #1399760)

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


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

Author:    Ryan Long <ryan.long at oarcorp.com>
Date:      Tue Mar  2 12:40:36 2021 -0500

gr_rasta_spw_router.c: Fix Unchecked return value from library (CID #1399760)

CID 1399760: Unchecked return value from library in gr_rasta_spw_router_init1().

Closes #4283

---

 bsps/shared/grlib/pci/gr_rasta_spw_router.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bsps/shared/grlib/pci/gr_rasta_spw_router.c b/bsps/shared/grlib/pci/gr_rasta_spw_router.c
index 6efbaa4..33168cf 100644
--- a/bsps/shared/grlib/pci/gr_rasta_spw_router.c
+++ b/bsps/shared/grlib/pci/gr_rasta_spw_router.c
@@ -394,6 +394,7 @@ int gr_rasta_spw_router_init1(struct drvmgr_dev *dev)
 	uint32_t bar0, bar0_size;
 	union drvmgr_key_value *value;
 	int resources_cnt;
+	int sc;
 
 	priv = dev->priv;
 	if (!priv)
@@ -410,7 +411,8 @@ int gr_rasta_spw_router_init1(struct drvmgr_dev *dev)
 
 	strcpy(priv->prefix, "/dev/spwrouter0");
 	priv->prefix[14] += dev->minor_drv;
-	mkdir(priv->prefix, S_IRWXU | S_IRWXG | S_IRWXO);
+	sc = mkdir(priv->prefix, S_IRWXU | S_IRWXG | S_IRWXO);
+	_Assert_Unused_variable_equals(sc, 0);
 	priv->prefix[15] = '/';
 	priv->prefix[16] = '\0';
 



More information about the vc mailing list