Skip to content

Commit

Permalink
chassis.c: Fix the possible NULL pointer deference in chassis_cleanup().
Browse files Browse the repository at this point in the history
If chassis_rec is NULL but chassis_private_rec is not, chassis_rec->name
is a NULL pointer deference. This patch fixes it.

Fixes: 4adc10f ("Avoid nb_cfg update notification flooding")
Acked-by: Numan Siddique <numans@ovn.org>
Signed-off-by: Han Zhou <hzhou@ovn.org>
  • Loading branch information
hzhou8 committed Sep 15, 2020
1 parent 14459a7 commit 7c6009a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controller/chassis.c
Expand Up @@ -843,7 +843,8 @@ chassis_cleanup(struct ovsdb_idl_txn *ovnsb_idl_txn,
if (ovnsb_idl_txn) {
ovsdb_idl_txn_add_comment(ovnsb_idl_txn,
"ovn-controller: unregistering chassis '%s'",
chassis_rec->name);
chassis_rec ? chassis_rec->name
: chassis_private_rec->name);
if (chassis_rec) {
sbrec_chassis_delete(chassis_rec);
}
Expand Down

0 comments on commit 7c6009a

Please sign in to comment.