[PATCH 07/12] gr_rasta_tmtc.c: Fix Unchecked return value from library (CID #1399771)

Ryan Long thisisryanlong at gmail.com
Thu Mar 4 14:05:08 UTC 2021


CID 1399771: Unchecked return value from library in gr_rasta_tmtc_init1().

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

diff --git a/bsps/shared/grlib/pci/gr_rasta_tmtc.c b/bsps/shared/grlib/pci/gr_rasta_tmtc.c
index bef2927..ccd1df4 100644
--- a/bsps/shared/grlib/pci/gr_rasta_tmtc.c
+++ b/bsps/shared/grlib/pci/gr_rasta_tmtc.c
@@ -574,6 +574,7 @@ int gr_rasta_tmtc_init1(struct drvmgr_dev *dev)
 	uint32_t bar0, bar1, bar0_size, bar1_size;
 	union drvmgr_key_value *value;
 	int resources_cnt;
+	int sc;
 
 	priv = dev->priv;
 	if (!priv)
@@ -587,7 +588,8 @@ int gr_rasta_tmtc_init1(struct drvmgr_dev *dev)
 
 	strcpy(priv->prefix, "/dev/rastatmtc0");
 	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';
 
-- 
1.8.3.1



More information about the devel mailing list