- entry = ext_db->tbl_scope_ll.head;
- while (entry != NULL) {
- tbl_scope_cb = (struct tf_tbl_scope_cb *)entry;
- entry = entry->next;
- tparms.tbl_scope_id = tbl_scope_cb->tbl_scope_id;
-
- if (dev->ops->tf_dev_free_tbl_scope) {
- dev->ops->tf_dev_free_tbl_scope(tfp, &tparms);
- } else {
- /* should not reach here */
- ll_delete(&ext_db->tbl_scope_ll, &tbl_scope_cb->ll_entry);
- tfp_free(tbl_scope_cb);
+ if (ext_db != NULL) {
+ entry = ext_db->tbl_scope_ll.head;
+ while (entry != NULL) {
+ tbl_scope_cb = (struct tf_tbl_scope_cb *)entry;
+ entry = entry->next;
+ tparms.tbl_scope_id =
+ tbl_scope_cb->tbl_scope_id;
+
+ if (dev->ops->tf_dev_free_tbl_scope) {
+ dev->ops->tf_dev_free_tbl_scope(tfp,
+ &tparms);
+ } else {
+ /* should not reach here */
+ ll_delete(&ext_db->tbl_scope_ll,
+ &tbl_scope_cb->ll_entry);
+ tfp_free(tbl_scope_cb);
+ }