Could check this?

Maksim Yevmenkin maksim.yevmenkin at savvis.net
Fri Jul 29 14:47:42 GMT 2005


Oliver,

> In file ng_l2cap_llpi.c func ng_l2cap_lp_con_ind(...) 
> concretely line:251:
> 
> 	/* Create and send LP_ConnectRsp event */
> 	NG_MKMESSAGE(rsp, NGM_HCI_COOKIE, NGM_HCI_LP_CON_RSP,
> 		sizeof(*rp), M_NOWAIT);
> 	if (msg == NULL) {
> 		ng_l2cap_free_con(con);
> 		error = ENOMEM;
> 		goto out;
> 	}
> 
> NG_MKMESSAGE function creates a NG_MESSAGE called rsp? for being send with 
> NG_SEND_MSG_HOOK afterwards, am I right?

yes, you are right

> if it is, shouldnt we be cheking the rsp pointer instead of msg ?
> ...the msg pointer is used much before in this func...so if it was NULL it 
> should have crashed much before...

yes, its a bug/typo. thank you for finding and submitting it.

> Am I missing something?

no, fix committed to -current.

===

emax        2005-07-29 14:44:17 UTC

  FreeBSD src repository

  Modified files:
    sys/netgraph/bluetooth/l2cap ng_l2cap_llpi.c
  Log:
  Fix typo and check correct (rsp) pointer against the NULL value.

  Submitted by:   Oliver < urnenfel at tiscali dot es >
  MFC after:      1 day

  Revision  Changes    Path
  1.9       +1 -1      src/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c

thanks,
max



More information about the freebsd-bluetooth mailing list