[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <153385821305.37448.14883992808536908679@swboyd.mtv.corp.google.com>
Date: Thu, 09 Aug 2018 16:43:33 -0700
From: Stephen Boyd <swboyd@...omium.org>
To: Julius Werner <jwerner@...omium.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
LKML <linux-kernel@...r.kernel.org>,
Wei-Ning Huang <wnhuang@...omium.org>,
Julius Werner <jwerner@...omium.org>,
Brian Norris <briannorris@...omium.org>, samuel@...lland.org
Subject: Re: [PATCH v3 6/7] firmware: coreboot: Only populate devices in
coreboot_table_init()
Quoting Julius Werner (2018-08-09 14:02:53)
> On Thu, Aug 9, 2018 at 10:17 AM Stephen Boyd <swboyd@...omium.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.
Powered by blists - more mailing lists