Luciano Coelho <coelho@xxxxxx> writes: >> + if (index >= WL1271_MAX_RX_DATA_FILTERS) { >> + wl1271_warning("acx_set_rx_data_filter: invalid filter idx(%d)", >> + index); >> + return -EINVAL; >> + } > > Should we use BUG_ON instead? This is only used internally in the > driver, so if it get here, it's a bug. And if the filters come from > userspace, we should validate them before continuing anyway. BUG_ON() is evil and wireless drivers should really not use it, WARN_ON_ONCE() and return with an error is much more user friendly. -- Kalle Valo -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html