mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 06:50:10 +01:00
ethtool: accept %NULL as argument for nm_ethtool_data_get_by_optname()/nm_ethtool_id_get_by_name()
Often it is useful to not accept %NULL as input argument, to catch bugs. For simple functions like nm_ethtool_id_get_by_name(), such limitations are more annoying than helpful. Gracefully accept %NULL and treat is like an invalid ethtool option.
This commit is contained in:
parent
2027ff50af
commit
0d7d2425c4
1 changed files with 2 additions and 1 deletions
|
|
@ -196,7 +196,8 @@ nm_ethtool_data_get_by_optname (const char *optname)
|
|||
{
|
||||
gssize idx;
|
||||
|
||||
nm_assert (optname);
|
||||
if (!optname)
|
||||
return NULL;
|
||||
|
||||
_ASSERT_data ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue