lkml.org 
[lkml]   [2016]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] dell-wmi: Stop storing pointers to DMI tables
On Mon, Jan 18, 2016 at 10:09 AM, Andy Lutomirski <luto@amacapital.net> wrote:
> On Mon, Jan 18, 2016 at 7:44 AM, Jean Delvare <jdelvare@suse.de> wrote:
>>> +
>>> + if (dm->type != 0xb2 || dm->length <= 6)
>>> + return;
>>> +
>>> + table = container_of(dm, struct dell_bios_hotkey_table, header);
>>> +
>>> + hotkey_num = (table->header.length - 4) /
>>> + sizeof(struct dell_bios_keymap_entry);
>>
>> The problem is not introduced by your patch, but the length check is
>> inconsistent. sizeof(struct dell_bios_keymap_entry) is 4.
>
> Yes, but sizeof(struct dell_bios_keymap_table) is 6.

No it's not. It's 4. And my math below was all messed up, too.

You were exactly right, and I'll fix it.

--Andy

\
 
 \ /
  Last update: 2016-01-18 19:41    [W:0.085 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site