mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Amitkumar Karwar <akarwar@marvell.com>
To: Loic Poulain <loic.poulain@intel.com>,
	Jeffy Chen <jeffy.chen@rock-chips.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Ganapathi Bhat" <gbhat@marvell.com>,
	Marcel Holtmann <marcel@holtmann.org>
Subject: RE: [v11,3/3] Bluetooth: hci_uart: Support firmware download for Marvell
Date: Tue, 9 Aug 2016 16:18:02 +0000	[thread overview]
Message-ID: <2680ec4f15c0459298c7ca91bdf73f31@SC-EXCH04.marvell.com> (raw)
In-Reply-To: <5774FA48.7080803@intel.com>

Hi Loic,

> -----Original Message-----
> From: Loic Poulain [mailto:loic.poulain@intel.com]
> Sent: Thursday, June 30, 2016 4:24 PM
> To: Amitkumar Karwar; Jeffy Chen; linux-bluetooth@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; Ganapathi Bhat; Cathy Luo; Marcel
> Holtmann
> Subject: Re: [v11,3/3] Bluetooth: hci_uart: Support firmware download
> for Marvell
> 
> Hi Amitkumar,
> 
> 
> > Hi Marcel,
> 
> I suggest you to add Marcel as recipient of your patches.
> 
> >
> >> From: Jeffy Chen [mailto:jeffy.chen@rock-chips.com]
> >> Sent: Friday, June 24, 2016 11:32 AM
> >> To: Amitkumar Karwar; linux-bluetooth@vger.kernel.org
> >> Cc: linux-kernel@vger.kernel.org; Ganapathi Bhat
> >> Subject: Re: [v11,3/3] Bluetooth: hci_uart: Support firmware download
> >> for Marvell
> >>
> >> On 2016-5-6 23:31, Amitkumar Karwar wrote:
> >>> From: Ganapathi Bhat <gbhat@marvell.com>
> >>>
> >>> This patch implement firmware download feature for Marvell Bluetooth
> >>> devices. If firmware is already downloaded, it will skip
> downloading.
> 
> 
> >>> +static struct sk_buff *mrvl_process_fw_data(struct hci_uart *hu,
> >>> +					    struct sk_buff *skb,
> >>> +					    u8 *buf, int count)
> >>> +{
> >>> +	struct mrvl_data *mrvl = hu->priv;
> >>> +	struct fw_data *fw_data = mrvl->fwdata;
> >>> +	int i = 0, len;
> >>> +
> >>> +	if (!skb) {
> >>> +		while (buf[i] != fw_data->expected_ack && i < count)
> >>> +			i++;
> >>> +		if (i == count)
> >>> +			return ERR_PTR(-EILSEQ);
> >>> +
> >>> +		skb = bt_skb_alloc(MRVL_FW_HDR_LEN, GFP_KERNEL);
> 
> Why you don't test skb here.
> 
> >>> +	}
> >>> +
> >>> +	if (!skb)
> >>> +		return ERR_PTR(-ENOMEM);
> >>> +
> >>> +	len = count - i;
> >>> +	memcpy(skb_put(skb, len), &buf[i], len);
> 
> You copy all the remaining data from buf into your skb, but what if buf
> contains more than one packet ? out of skb.
> Don't assume that buf contains a full packet as well as only one packet.
> 
> 

Thanks for your comments. We have added necessarily checks to address these comments. I will submit updated version shortly.

Regards,
Amitkumar Karwar

  reply	other threads:[~2016-08-09 16:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 15:31 [PATCH v11 1/3] Bluetooth: hci_uart: add prepare callbacks to hci_uart_proto structure Amitkumar Karwar
2016-05-06 15:31 ` [PATCH v11 2/3] Bluetooth: hci_uart: check if hdev is present before using it Amitkumar Karwar
2016-06-24  6:01   ` [v11, " Jeffy Chen
2016-05-06 15:31 ` [PATCH v11 3/3] Bluetooth: hci_uart: Support firmware download for Marvell Amitkumar Karwar
2016-05-10 13:59   ` Amitkumar Karwar
2016-05-23  6:06   ` Amitkumar Karwar
2016-06-14  6:35   ` Amitkumar Karwar
2016-06-21  3:47   ` [v11,3/3] " Caesar Wang
2016-06-24  6:02   ` Jeffy Chen
2016-06-27  6:28     ` Amitkumar Karwar
2016-06-30 10:54       ` Loic Poulain
2016-08-09 16:18         ` Amitkumar Karwar [this message]
2016-06-24  6:01 ` [v11, 1/3] Bluetooth: hci_uart: add prepare callbacks to hci_uart_proto structure Jeffy Chen

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=2680ec4f15c0459298c7ca91bdf73f31@SC-EXCH04.marvell.com \
    --to=akarwar@marvell.com \
    --cc=gbhat@marvell.com \
    --cc=jeffy.chen@rock-chips.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@intel.com \
    --cc=marcel@holtmann.org \
    /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

all inboxes | Powered by JetHome®