[rtems commit] gr_701.c: Unchecked return value from library (CID #1399783 )

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


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

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

gr_701.c: Unchecked return value from library (CID #1399783)

CID 1399783: Unchecked return value from library in gr701_init1().

Closes #4288

---

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

diff --git a/bsps/shared/grlib/pci/gr_701.c b/bsps/shared/grlib/pci/gr_701.c
index c9ac0db..25dc680 100644
--- a/bsps/shared/grlib/pci/gr_701.c
+++ b/bsps/shared/grlib/pci/gr_701.c
@@ -316,6 +316,7 @@ int gr701_init1(struct drvmgr_dev *dev)
 	struct pci_dev_info *devinfo;
 	uint32_t bar0, bar1, bar0_size, bar1_size;
 	int resources_cnt;
+	int sc;
 
 	priv = grlib_calloc(1, sizeof(*priv));
 	if ( !priv )
@@ -330,7 +331,8 @@ int gr701_init1(struct drvmgr_dev *dev)
 	/* Generate Device prefix */
 	strcpy(priv->prefix, "/dev/gr701_0");
 	priv->prefix[11] += 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[12] = '/';
 	priv->prefix[13] = '\0';
 



More information about the vc mailing list