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

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


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

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

gr_tmtc_1553.c: Unchecked return value from library (CID #1399785)

CID 1399785: Unchecked return value from library in gr_tmtc_1553_init1().

Closes #4289

---

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

diff --git a/bsps/shared/grlib/pci/gr_tmtc_1553.c b/bsps/shared/grlib/pci/gr_tmtc_1553.c
index ce02b8a..55a6358 100644
--- a/bsps/shared/grlib/pci/gr_tmtc_1553.c
+++ b/bsps/shared/grlib/pci/gr_tmtc_1553.c
@@ -291,6 +291,7 @@ int gr_tmtc_1553_init1(struct drvmgr_dev *dev)
 	int status;
 	uint32_t bar0, bar0_size;
 	int resources_cnt;
+	int sc;
 
 	/* PCI device does not have the IRQ line register, when PCI autoconf configures it the configuration
 	 * is forgotten. We take the IRQ number from the PCI Host device (AMBA device), this works as long
@@ -314,7 +315,8 @@ int gr_tmtc_1553_init1(struct drvmgr_dev *dev)
 
 	strcpy(priv->prefix, "/dev/tmtc1553_0");
 	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