From: Vinod Koul <vinod.koul@intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
alsa-devel@alsa-project.org, "Nc, Shreyas" <shreyas.nc@intel.com>
Subject: Re: [PATCH] ASoC: Intel: Skylake: Add DSP firmware manifest parsing
Date: Tue, 12 Apr 2016 10:24:16 +0530 [thread overview]
Message-ID: <20160412045416.GD2274@localhost> (raw)
In-Reply-To: <20160412041207.GU3351@sirena.org.uk>
[-- Attachment #1.1: Type: text/plain, Size: 1383 bytes --]
On Tue, Apr 12, 2016 at 05:12:07AM +0100, Mark Brown wrote:
> On Sun, Apr 03, 2016 at 03:19:14AM +0530, Vinod Koul wrote:
>
> > + for (i = 0; i < num; i++) {
> > + if (!strcmp(uuid, tbl[i].uuid)) {
>
> Do we really want to be working with UUIDs in string format all the
> time? It seems error prone and as far as I can see at least some of the
> time we get them in in binary format.
I agree that it would be saner to handle uuid in bin format and print to
strings when string are required.
> > + sprintf(buf, "%08X", entry->uuid.id_1);
> > + sprintf(buf+strlen(buf), "-");
>
> Coding style, spaces around +. I'd also like to be a bit more confident
> that this can't result in a buffer overflow, sprintf() isn't reassuring
> especially in conjunction with buf being passed in from elsewhere with
> no length information.
Okay I think we cna remove this if don't use strings
> > + adsp_hdr = (struct adsp_fw_hdr *)(buf + SKL_ADSP_FW_BIN_HDR_OFFSET);
> > +
> > + mod_entry = (struct adsp_module_entry *)
> > + (buf + SKL_ADSP_FW_BIN_HDR_OFFSET + adsp_hdr->header_len);
> > +
> > + num_entry = adsp_hdr->num_module_entries;
>
> > + for (i = 0; i < num_entry; i++, mod_entry++) {
> > + get_canonical_uuid(uuid_str, mod_entry);
>
> We're not checking that we're not walking off the end of the file here.
Will fix
Thanks
--
~Vinod
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
prev parent reply other threads:[~2016-04-12 4:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-02 21:49 [PATCH] ASoC: Intel: Skylake: Add DSP firmware manifest parsing Vinod Koul
2016-04-12 4:12 ` Mark Brown
2016-04-12 4:54 ` Vinod Koul [this message]
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=20160412045416.GD2274@localhost \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.com \
--cc=shreyas.nc@intel.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).