Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753318AbcDFUnM (ORCPT ); Wed, 6 Apr 2016 16:43:12 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43449 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751776AbcDFUnI (ORCPT ); Wed, 6 Apr 2016 16:43:08 -0400 Subject: Re: [PATCH V2 1/9] acpi: apei: read ack upon ghes record consumption To: Suzuki K Poulose , fu.wei@linaro.org, timur@codeaurora.org, harba@codeaurora.org, rruigrok@codeaurora.org, ahs3@redhat.com, catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, lenb@kernel.org, matt@codeblueprint.co.uk, robert.moore@intel.com, lv.zheng@intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-efi@vger.kernel.org, devel@acpica.org References: <1459955578-24602-1-git-send-email-tbaicar@codeaurora.org> <1459955578-24602-2-git-send-email-tbaicar@codeaurora.org> <57053100.7050305@arm.com> Cc: "Jonathan (Zhixiong) Zhang" , Naveen Kaje From: "Baicar, Tyler" Message-ID: <570574D8.8060402@codeaurora.org> Date: Wed, 6 Apr 2016 14:43:04 -0600 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <57053100.7050305@arm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1756 Lines: 50 Hello Suzuki, On 4/6/2016 9:53 AM, Suzuki K Poulose wrote: > On 06/04/16 16:12, Tyler Baicar wrote: >> + hest_hdr = (struct acpi_hest_header *)generic; >> + if (hest_hdr->type == ACPI_HEST_TYPE_GENERIC_ERROR_V2) { >> + ghes->generic_v2 = (struct acpi_hest_generic_v2 *)generic; >> + rc = apei_map_generic_address( >> + &ghes->generic_v2->read_ack_register); >> + if (rc) >> + goto err_unmap; >> + } else >> + ghes->generic_v2 = NULL; > ... >> err_unmap: >> apei_unmap_generic_address(&generic->error_status_address); >> + if (ghes->generic_v2) >> + apei_unmap_generic_address( >> + &ghes->generic_v2->read_ack_register); >> err_free: >> kfree(ghes); >> return ERR_PTR(rc); >> @@ -279,6 +295,9 @@ static void ghes_fini(struct ghes *ghes) >> { >> kfree(ghes->estatus); >> apei_unmap_generic_address(&ghes->generic->error_status_address); >> + if (ghes->generic_v2) >> + apei_unmap_generic_address( >> + &ghes->generic_v2->error_status_address); > > I am not familiar with the APEI code, but is this error_status_address or > read_ack_register ? We don't seem to be mapping error_status_address > in generic_v2 header > which is introduced in this patch ? Am I missing something ? > > Suzuki Thank you for your feedback. This does look like an error; it should be &ghes->generic_v2->read_ack_register. The variable &ghes->generic_v2->error_status_address is the same as &ghes->generic->error_status_address which is unmapped on the line above the if statement here. Thanks, Tyler -- Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project