From patchwork Fri Jul 10 18:14:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Luck X-Patchwork-Id: 6767911 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 62DD79F38C for ; Fri, 10 Jul 2015 18:14:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03D8C20576 for ; Fri, 10 Jul 2015 18:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8167C20575 for ; Fri, 10 Jul 2015 18:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933138AbbGJSOU (ORCPT ); Fri, 10 Jul 2015 14:14:20 -0400 Received: from mga03.intel.com ([134.134.136.65]:45599 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933324AbbGJSOL (ORCPT ); Fri, 10 Jul 2015 14:14:11 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 10 Jul 2015 11:14:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,448,1432623600"; d="scan'208";a="603859574" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga003.jf.intel.com with ESMTP; 10 Jul 2015 11:14:10 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.16]) by ORSMSX108.amr.corp.intel.com ([169.254.4.52]) with mapi id 14.03.0224.002; Fri, 10 Jul 2015 11:14:10 -0700 From: "Luck, Tony" To: Konstantin Khlebnikov , "linux-acpi@vger.kernel.org" , "Chen, Gong" CC: "linux-kernel@vger.kernel.org" , "Tomasz Nowicki" Subject: RE: [PATCH] acpi/apei: free lists of resources in einj and erst Thread-Topic: [PATCH] acpi/apei: free lists of resources in einj and erst Thread-Index: AQHQuwfDllvSzT6Gxk2m6fUdLk9PT53VAZOw Date: Fri, 10 Jul 2015 18:14:09 +0000 Message-ID: <3908561D78D1C84285E8C5FCA982C28F32AA5A72@ORSMSX114.amr.corp.intel.com> References: <20150710115832.13167.20624.stgit@buzz> In-Reply-To: <20150710115832.13167.20624.stgit@buzz> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This bit looks wrong ... the line right after the this diff ends is goto out_fini; so we'll call apei_resources_fini() twice in the rc!=0 case. -Tony --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -379,10 +379,9 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, rc = apei_resources_add(&addr_resources, trigger_param_region->address, trigger_param_region->bit_width/8, true); - if (rc) - goto out_fini; - rc = apei_resources_sub(&trigger_resources, - &addr_resources); + if (!rc) + rc = apei_resources_sub(&trigger_resources, + &addr_resources); } apei_resources_fini(&addr_resources); if (rc)