Hi Johan, On Wed, Mar 30, 2011 at 6:18 AM, <johan.hedberg@xxxxxxxxx> wrote: > +int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi, > + u8 *eir) > +{ > + struct mgmt_ev_device_found ev; > + > + memset(&ev, 0, sizeof(ev)); > + > + bacpy(&ev.bdaddr, bdaddr); > + memcpy(ev.dev_class, dev_class, 3); What about "sizeof(ev.dev_class)" instead of 3 ? > + ev.rssi = rssi; > + > + if (eir) > + memcpy(ev.eir, eir, HCI_MAX_EIR_LENGTH); This could be "sizeof(ev.eir)" as well, although it is already clear by the #define. > + > + return mgmt_event(MGMT_EV_DEVICE_FOUND, index, &ev, sizeof(ev), NULL); > +} Regards, -- Anderson Lizardo Instituto Nokia de Tecnologia - INdT Manaus - Brazil -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html