Hi Dan, On 8/8/2019 4:18 PM, Dan Carpenter wrote: > > Hello Ajay Singh, > > The patch 9bc061e88054: "staging: wilc1000: added support to > dynamically add/remove interfaces" from Jun 26, 2019, leads to the > following static checker warning: > > drivers/staging/wilc1000/wilc_wlan.c:497 wilc_wlan_handle_txq() > warn: missing error code here? 'wilc_wlan_txq_get_first()' failed. > > drivers/staging/wilc1000/wilc_wlan.c > 474 int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count) > 475 { > 476 int i, entries = 0; > 477 u32 sum; > 478 u32 reg; > 479 u32 offset = 0; > 480 int vmm_sz = 0; > 481 struct txq_entry_t *tqe; > 482 int ret = 0; > ^^^^^^^ > > 483 int counter; > 484 int timeout; > 485 u32 vmm_table[WILC_VMM_TBL_SIZE]; > 486 const struct wilc_hif_func *func; > 487 u8 *txb = wilc->tx_buffer; > 488 struct net_device *dev; > 489 struct wilc_vif *vif; > 490 > 491 if (wilc->quit) > 492 goto out; > 493 > 494 mutex_lock(&wilc->txq_add_to_head_cs); > 495 tqe = wilc_wlan_txq_get_first(wilc); > 496 if (!tqe) > 497 goto out; > ^^^^^^^^ > Should this really be a success path?
I think, returning value '0' is safe here. Only 'ENOBUFS' return value is used for retry while other values are not considered. The 'if' condition exit this function in case the list is empty. And later the elements will be fetched again once'txq_event' completion signal is received. Regards, Ajay _______________________________________________ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel