Messages in this thread | | | From | Stephen Boyd <> | Subject | Re: [PATCH v3 6/7] firmware: coreboot: Only populate devices in coreboot_table_init() | Date | Thu, 09 Aug 2018 16:43:33 -0700 |
| |
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.
| |