12 Apr
2016
12 Apr
'16
7:12 a.m.
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.
- 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.
- 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.