From: Dan Carpenter <error27@gmail.com>
To: pavan_savoy@ti.com
Cc: marcel@holtmann.org, padovan@profusion.mobi,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6] Bluetooth: btwilink driver
Date: Mon, 22 Nov 2010 19:46:23 +0300 [thread overview]
Message-ID: <20101122164623.GB8882@bicker> (raw)
In-Reply-To: <1290424125-2717-1-git-send-email-pavan_savoy@ti.com>
On Mon, Nov 22, 2010 at 06:08:45AM -0500, pavan_savoy@ti.com 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
next prev parent reply other threads:[~2010-11-22 16:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-22 11:08 [PATCH v6] Bluetooth: btwilink driver pavan_savoy
2010-11-22 16:46 ` Dan Carpenter [this message]
2010-11-23 12:37 ` Pavan Savoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101122164623.GB8882@bicker \
--to=error27@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=padovan@profusion.mobi \
--cc=pavan_savoy@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).