Dan, Marcel, Gustavo, On Mon, Nov 22, 2010 at 10:16 PM, Dan Carpenter <error27@xxxxxxxxx> wrote: > On Mon, Nov 22, 2010 at 06:08:45AM -0500, pavan_savoy@xxxxxx wrote: >> +static int bt_ti_probe(struct platform_device *pdev) >> +{ >> + Â Â static struct ti_st *hst; >> + Â Â struct hci_dev *hdev; >> + Â Â int err; >> + >> + Â Â hst = kzalloc(sizeof(struct ti_st), GFP_KERNEL); >> + Â Â if (!hst) >> + Â Â Â Â Â Â return -ENOMEM; >> + >> + Â Â /* Expose "hciX" device to user space */ >> + Â Â hdev = hci_alloc_dev(); >> + Â Â if (!hdev) { >> + Â Â Â Â Â Â kfree(hst); >> + Â Â Â Â Â Â return -ENOMEM; >> + Â Â } >> + >> + Â Â BT_DBG("hdev %p", hdev); >> + >> + Â Â hst->hdev = hdev; >> + Â Â hdev->bus = HCI_UART; >> + Â Â hdev->driver_data = hst; >> + Â Â hdev->open = ti_st_open; >> + Â Â hdev->close = ti_st_close; >> + Â Â hdev->flush = NULL; >> + Â Â hdev->send = ti_st_send_frame; >> + Â Â hdev->destruct = ti_st_destruct; >> + Â Â hdev->owner = THIS_MODULE; >> + >> + Â Â err = hci_register_dev(hdev); >> + Â Â if (err < 0) { >> + Â Â Â Â Â Â BT_ERR("Can't register HCI device error %d", err); >> + Â Â Â Â Â Â hci_free_dev(hdev); > > Â Â Â ÂShould there be a kfree(hst); here? ÂThat's how it's done in > Â Â Â Âbpa10x_probe() from drivers/bluetooth/bpa10x.c > >> + Â Â Â Â Â Â return err; >> + Â Â } >> + >> + Â Â BT_DBG(" HCI device registered (hdev %p)", hdev); > Â Â Â Â Â Â Â Â^ > Â Â Â ÂQuite a few places have an extra space at the start. > >> + >> + Â Â dev_set_drvdata(&pdev->dev, hst); >> + Â Â return err; >> +} > > regards, > dan carpenter Thanks Dan for the comments, Marcel, Gustavo - Please provide your comments too... So I can bundle them all and post a v7 .... > -- > 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 > -- 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