@@ -1550,9 +1550,13 @@ ioc_parse(const char *opts)
1550
1550
{
1551
1551
char * tmp ;
1552
1552
char * param = strdup (opts );
1553
+ int rc ;
1553
1554
1554
1555
tmp = strtok (param , "," );
1555
- snprintf (virtual_uart_path , sizeof (virtual_uart_path ), "%s" , param );
1556
+ rc = snprintf (virtual_uart_path , sizeof (virtual_uart_path ), "%s" , param );
1557
+ if (rc < 0 || rc >= sizeof (virtual_uart_path ))
1558
+ WPRINTF ("ioc gets incomplete virtual uart path:%s\r\n" ,
1559
+ virtual_uart_path );
1556
1560
if (tmp != NULL ) {
1557
1561
tmp = strtok (NULL , "," );
1558
1562
if (tmp != NULL ) {
@@ -1575,6 +1579,7 @@ int
1575
1579
ioc_init (struct vmctx * ctx )
1576
1580
{
1577
1581
int i ;
1582
+ int rc ;
1578
1583
struct ioc_dev * ioc ;
1579
1584
1580
1585
IOC_LOG_INIT ;
@@ -1668,7 +1673,10 @@ ioc_init(struct vmctx *ctx)
1668
1673
ARRAY_SIZE (wlist_tx_group_table ));
1669
1674
1670
1675
/* Setup IOC rx members */
1671
- snprintf (ioc -> rx_name , sizeof (ioc -> rx_name ), "ioc_rx" );
1676
+ rc = snprintf (ioc -> rx_name , sizeof (ioc -> rx_name ), "ioc_rx" );
1677
+ if (rc < 0 )
1678
+ WPRINTF ("%s" , "ioc fails to set ioc_rx thread name\r\n" );
1679
+
1672
1680
ioc -> ioc_dev_rx = cbc_rx_handler ;
1673
1681
pthread_cond_init (& ioc -> rx_cond , NULL );
1674
1682
pthread_mutex_init (& ioc -> rx_mtx , NULL );
@@ -1683,7 +1691,10 @@ ioc_init(struct vmctx *ctx)
1683
1691
ioc -> rx_config .wlist_grp_tbl = wlist_rx_group_table ;
1684
1692
1685
1693
/* Setup IOC tx members */
1686
- snprintf (ioc -> tx_name , sizeof (ioc -> tx_name ), "ioc_tx" );
1694
+ rc = snprintf (ioc -> tx_name , sizeof (ioc -> tx_name ), "ioc_tx" );
1695
+ if (rc < 0 )
1696
+ WPRINTF ("%s" , "ioc fails to set ioc_tx thread name\r\n" );
1697
+
1687
1698
ioc -> ioc_dev_tx = cbc_tx_handler ;
1688
1699
pthread_cond_init (& ioc -> tx_cond , NULL );
1689
1700
pthread_mutex_init (& ioc -> tx_mtx , NULL );
@@ -1710,7 +1721,10 @@ ioc_init(struct vmctx *ctx)
1710
1721
if (ioc_create_thread (ioc -> tx_name , & ioc -> tx_tid , ioc_tx_thread ,
1711
1722
(void * )ioc ) < 0 )
1712
1723
goto work_err ;
1713
- snprintf (ioc -> name , sizeof (ioc -> name ), "ioc_core" );
1724
+ rc = snprintf (ioc -> name , sizeof (ioc -> name ), "ioc_core" );
1725
+ if (rc < 0 )
1726
+ WPRINTF ("%s" , "ioc fails to set ioc_core thread name\r\n" );
1727
+
1714
1728
if (ioc_create_thread (ioc -> name , & ioc -> tid , ioc_core_thread ,
1715
1729
(void * )ioc ) < 0 )
1716
1730
goto work_err ;
0 commit comments