From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751400AbdALJ5B (ORCPT ); Thu, 12 Jan 2017 04:57:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35658 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbdALJ47 (ORCPT ); Thu, 12 Jan 2017 04:56:59 -0500 Date: Thu, 12 Jan 2017 17:56:49 +0800 From: Dave Young To: Matt Fleming , Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Nicolai Stange , Ingo Molnar , Thomas Gleixner , hpa@zytor.com, Dan Williams , mika.penttila@nextfour.com, bhsharma@redhat.com Subject: Re: [PATCH 2/4] efi/x86: move efi bgrt init code to early init code Message-ID: <20170112095649.GA5045@dhcp-128-65.nay.redhat.com> References: <20170112094118.815108042@redhat.com> <20170112094214.909117564@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170112094214.909117564@redhat.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 12 Jan 2017 09:56:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [snip] > --- linux-x86.orig/drivers/acpi/bgrt.c > +++ linux-x86/drivers/acpi/bgrt.c [snip] > > @@ -84,9 +85,17 @@ static int __init bgrt_init(void) > { > int ret; > > - if (!bgrt_image) > + if (!bgrt_tab.image_address) > return -ENODEV; > > + bgrt_image = memremap(bgrt_tab.image_address, bgrt_image_size, > + MEMREMAP_WB); > + if (!bgrt_image) { > + pr_notice("Ignoring BGRT: failed to map image memory\n"); > + bgrt_image = NULL; > + return -ENOMEM; > + } > + Oops, later error path need unmap bgrt_image, will update in next version after collecting more comments. Also bgrt_image = NULL is useless, will drop it. > bin_attr_image.private = bgrt_image; > bin_attr_image.size = bgrt_image_size; > Thanks Dave