aboutsummaryrefslogtreecommitdiff
path: root/lib/bond.c
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2013-07-19 12:59:51 -0700
committerEthan Jackson <ethan@nicira.com>2013-07-19 13:02:59 -0700
commitbca0b3b4e2ec98193258e67720bc29c81be6cd6f (patch)
tree516d06684fac555bac0ab59918b319d82da16467 /lib/bond.c
parent6d13e6dd6b73c9b00ac5943d8ec0ca7f9f822bda (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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bond.c b/lib/bond.c
index 183c37be..b3ae0c4b 100644
--- a/lib/bond.c
+++ b/lib/bond.c
@@ -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;
}