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>
{
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;
}