diff options
author | Ethan Jackson <ethan@nicira.com> | 2013-07-19 12:59:51 -0700 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2013-07-19 13:02:59 -0700 |
commit | bca0b3b4e2ec98193258e67720bc29c81be6cd6f (patch) | |
tree | 516d06684fac555bac0ab59918b319d82da16467 /lib/bond.c | |
parent | 6d13e6dd6b73c9b00ac5943d8ec0ca7f9f822bda (diff) |
bond: Support null argument to bond_ref().
This is consistent with the other ref functions, and was causing
segmentation faults in some test cases.
Reported-by: Mukesh Hira <mhira@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/bond.c')
-rw-r--r-- | lib/bond.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -195,8 +195,10 @@ bond_ref(const struct bond *bond_) { struct bond *bond = CONST_CAST(struct bond *, bond_); - ovs_assert(bond->ref_cnt > 0); - bond->ref_cnt++; + if (bond) { + ovs_assert(bond->ref_cnt > 0); + bond->ref_cnt++; + } return bond; } |