net: if: Check null pointer when settings flags
The iface pointer might be null so check it before access. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
89aa9c83cb
commit
d4b9620dda
1 changed files with 3 additions and 1 deletions
|
@ -538,7 +538,9 @@ static inline void net_if_flag_clear(struct net_if *iface,
|
||||||
static inline bool net_if_flag_is_set(struct net_if *iface,
|
static inline bool net_if_flag_is_set(struct net_if *iface,
|
||||||
enum net_if_flag value)
|
enum net_if_flag value)
|
||||||
{
|
{
|
||||||
NET_ASSERT(iface);
|
if (iface == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return atomic_test_bit(iface->if_dev->flags, value);
|
return atomic_test_bit(iface->if_dev->flags, value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue