mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 06:20:17 +01:00
platform: add NULL check in inline nmp_object_unref() function
This allows the compiler to see that this function does nothing for %NULL. That is not so unusual, as we use nm_auto_nmpobj to free objects. Often the compiler can see that these pointers are %NULL.
This commit is contained in:
parent
ac4a1deba0
commit
2c37a3fb1e
1 changed files with 4 additions and 2 deletions
|
|
@ -632,9 +632,11 @@ nmp_object_ref (const NMPObject *obj)
|
|||
static inline void
|
||||
nmp_object_unref (const NMPObject *obj)
|
||||
{
|
||||
nm_assert (!obj || NMP_OBJECT_IS_VALID (obj));
|
||||
if (obj) {
|
||||
nm_assert (NMP_OBJECT_IS_VALID (obj));
|
||||
|
||||
nm_dedup_multi_obj_unref ((const NMDedupMultiObj *) obj);
|
||||
nm_dedup_multi_obj_unref ((const NMDedupMultiObj *) obj);
|
||||
}
|
||||
}
|
||||
|
||||
#define nm_clear_nmp_object(ptr) \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue