lkml.org 
[lkml]   [2018]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 6/7] firmware: coreboot: Only populate devices in coreboot_table_init()
Date
Quoting Julius Werner (2018-08-09 14:02:53)
> On Thu, Aug 9, 2018 at 10:17 AM Stephen Boyd <swboyd@chromium.org> wrote:
> > @@ -162,26 +143,37 @@ static int coreboot_table_probe(struct platform_device *pdev)
> > if (!res->start || !len)
> > return -EINVAL;
> >
> > + /* Map and check just the header first to make sure things are sane */
> > header = memremap(res->start, sizeof(*header), MEMREMAP_WB);
> > - if (header == NULL)
> > + if (!header)
> > return -ENOMEM;
> >
> > - ptr = memremap(res->start, header->header_bytes + header->table_bytes,
> > - MEMREMAP_WB);
> > + if (strncmp(header->signature, "LBIO", sizeof(header->signature))) {
> > + dev_warn(dev, "coreboot table missing or corrupt!\n");
> > + return -ENODEV;
>
> Leaking the mapping here.

Thanks. Fixed.

\
 
 \ /
  Last update: 2018-08-10 01:44    [W:0.075 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site