<div dir="ltr">Hi,<div><br></div><div>While doing transaction code analysis, I found the following in lustre/target/tgt_lastrcvd.c.</div><div><br></div><div><div>    552 int tgt_new_client_cb_add(struct thandle *th, struct obd_export *exp)<br>    553 {<br>    554         struct tgt_new_client_callback  *ccb;<br>    555         struct dt_txn_commit_cb         *dcb;<br>    556         int                              rc;<br>    557<br><b><font color="#ff0000">    558         OBD_ALLOC_PTR(ccb);</font></b><br>    559         if (ccb == NULL)<br>    560                 return -ENOMEM;<br>    561<br>    562         ccb->lncc_exp = class_export_cb_get(exp);<br>    563<br>    564         dcb = &ccb->lncc_cb;<br>    565         dcb->dcb_func = tgt_cb_new_client;<br>    566         INIT_LIST_HEAD(&dcb->dcb_linkage);<br>    567         strlcpy(dcb->dcb_name, "tgt_cb_new_client", sizeof(dcb->dcb_name));<br>    568<br>    569         rc = dt_trans_cb_add(th, dcb);<br>    570         if (rc) {<br>    571                 class_export_cb_put(exp);<br><b><font color="#ff0000">    572                 OBD_FREE_PTR(ccb);</font></b><br>    573         }<br>    574         return rc;<br>    575 }<br></div><div><br></div><div>OBD_FREE_PTR() is in the condition block which means that the expectation is dt_trans_cb_add() returns something "!= 0".</div><div><br></div><div>From the code, osd_trans_cb_add() and osp_trans_cb_add() returns zero value.  So, my point is OBD_FREE_PTR() should be outside the condition block.</div><div><br></div><div>Please correct me if my understanding is incorrect.</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Regards<br><br>Sudheendra Sampath</div></div></div>