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

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


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

Author:    Ryan Long <ryan.long at oarcorp.com>
Date:      Tue Mar  2 13:01:43 2021 -0500

gr_leon4_n2x.c: Fix Unchecked return value from library (CID #1399767)

CID 1399767: Unchecked return value error from library in gr_cpci_leon4_n2x_init1().

Closes #4285

---

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

diff --git a/bsps/sparc/shared/pci/gr_leon4_n2x.c b/bsps/sparc/shared/pci/gr_leon4_n2x.c
index 9baf73e..af7a5d7 100644
--- a/bsps/sparc/shared/pci/gr_leon4_n2x.c
+++ b/bsps/sparc/shared/pci/gr_leon4_n2x.c
@@ -478,6 +478,7 @@ int gr_cpci_leon4_n2x_init1(struct drvmgr_dev *dev)
 	int status, i;
 	union drvmgr_key_value *value;
 	int resources_cnt;
+	int sc;
 
 	priv = dev->priv;
 	if (!priv)
@@ -494,7 +495,8 @@ int gr_cpci_leon4_n2x_init1(struct drvmgr_dev *dev)
 
 	strcpy(priv->prefix, "/dev/leon4n2x0");
 	priv->prefix[13] += 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[14] = '/';
 	priv->prefix[15] = '\0';
 



More information about the vc mailing list