libiwinfo: fix segfaults in nl80211 hwmodelist and freqlist operations if called on a not existing phy
This commit is contained in:
parent
ff892ab41a
commit
7dc764e861
1 changed files with 2 additions and 2 deletions
|
@ -1438,7 +1438,7 @@ int nl80211_get_freqlist(const char *ifname, char *buf, int *len)
|
||||||
if( req )
|
if( req )
|
||||||
{
|
{
|
||||||
res = nl80211_send(req);
|
res = nl80211_send(req);
|
||||||
if( res )
|
if( res && res->attr[NL80211_ATTR_WIPHY_BANDS] )
|
||||||
{
|
{
|
||||||
nla_for_each_nested(band,
|
nla_for_each_nested(band,
|
||||||
res->attr[NL80211_ATTR_WIPHY_BANDS], bands_remain)
|
res->attr[NL80211_ATTR_WIPHY_BANDS], bands_remain)
|
||||||
|
@ -1537,7 +1537,7 @@ int nl80211_get_hwmodelist(const char *ifname, int *buf)
|
||||||
if( req )
|
if( req )
|
||||||
{
|
{
|
||||||
res = nl80211_send(req);
|
res = nl80211_send(req);
|
||||||
if( res )
|
if( res && res->attr[NL80211_ATTR_WIPHY_BANDS] )
|
||||||
{
|
{
|
||||||
nla_for_each_nested(band,
|
nla_for_each_nested(band,
|
||||||
res->attr[NL80211_ATTR_WIPHY_BANDS], bands_remain)
|
res->attr[NL80211_ATTR_WIPHY_BANDS], bands_remain)
|
||||||
|
|
Loading…
Reference in a new issue