@@ -438,9 +438,11 @@ void lnet_res_lh_initialize(struct lnet_res_container *rec,
struct lnet_rsp_tracker *rspt;
rspt = kzalloc(sizeof(*rspt), GFP_NOFS);
- lnet_net_lock(cpt);
- the_lnet.ln_counters[cpt]->lct_health.lch_rst_alloc++;
- lnet_net_unlock(cpt);
+ if (rspt) {
+ lnet_net_lock(cpt);
+ the_lnet.ln_counters[cpt]->lct_health.lch_rst_alloc++;
+ lnet_net_unlock(cpt);
+ }
return rspt;
}
@@ -4390,7 +4390,7 @@ void lnet_monitor_thr_stop(void)
/* we already have an rspt attached to the md, so we'll
* update the deadline on that one.
*/
- kfree(rspt);
+ lnet_rspt_free(rspt, cpt);
new_entry = false;
} else {
/* new md */
@@ -4511,7 +4511,7 @@ void lnet_monitor_thr_stop(void)
md->md_me->me_portal);
lnet_res_unlock(cpt);
- kfree(rspt);
+ lnet_rspt_free(rspt, cpt);
kfree(msg);
return -ENOENT;
}
@@ -4745,7 +4745,7 @@ struct lnet_msg *
lnet_res_unlock(cpt);
kfree(msg);
- kfree(rspt);
+ lnet_rspt_free(rspt, cpt);
return -ENOENT;
}