lkml.org 
[lkml]   [2017]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] firmware: dmi: Check DMI structure length
On Thu, Jun 1, 2017 at 4:08 PM, Jean Delvare <jdelvare@suse.de> wrote:
> Before accessing DMI data to record it for later, we should ensure
> that the DMI structures are large enough to contain the data in
> question.

> - const u8 *d = (u8 *) dm + index;
> + const u8 *d;

> + d = (u8 *) dm + index;

I think you may leave this as is and make it compiler's burden to optimize.

> - const u8 *d = (u8 *) dm + index;
> + const u8 *d;

> + d = (u8 *) dm + index;

Ditto.

> - int i, count = *(u8 *)(dm + 1);
> + int i, count;

> + count = *(u8 *)(dm + 1);

Ditto.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2017-06-01 15:17    [W:0.080 / U:0.760 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site