Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2331652ybt; Fri, 3 Jul 2020 06:41:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWIh6PRjPOXFsZDGe9njF1lLwAdvWr539A69yhRQ4T/NMcK1nqqR3aubdRrcDf0lyrII7T X-Received: by 2002:a17:906:6d49:: with SMTP id a9mr31219297ejt.435.1593783692719; Fri, 03 Jul 2020 06:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593783692; cv=none; d=google.com; s=arc-20160816; b=c/byoceaNdyqVBQoJXG7liX5NrS3QczO2eMuLu6xEOukCBGTSylI6Cc33efA9DT5ye S8inHe/Jr9+IQjXqfG8qKYPhB/EhEmhirSGLuYqTCAZsWei30rxlBHhPHUF3nDMR+XBD fASfgwoVJYJsUXBSiO1fEykwKeZauvr0RF2+ARZNwJFtMqq9OAUfyJVwOS4q3tRiGIhW 1yjaRs9znEuPYoge2ceji6emuD2ClwoIADBhMFnY45XtZGtQAcTiYAzYzXNjZKtlx971 TTuRFP0sxnlUdjCnTpH7869fxvVN2kHKQU6HubdQvdlPFUY70iJ8dp89JJF7ciC5t2+3 dZlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EtLhU2i77FUsXNVo6j8K13haqXLSgGlY+OveqDaP62E=; b=erkz0tAHXZtQ0hJD2dNKFddhzVkX/geEJAiHCiqmPz2bLgs73kQQnWGYVE82eRlsiy H4+mfXoIrkPQ7X8uM5DMe7PQObiaOS1PcoEtx9KlW8MRXo8oEbh2sTkrgyuQhDMbYDRy H0ZuGGTiJ37+MLRxZVSSa0rPl+yuls1Kk20pJ4bmYdkh86GNF+dPxcMcGeGwVZ6WqR+/ WMURkWj6ncEIOO1dWmULnte+I2bQrMGXGqtb5V++EcwvG20vzWXZpbbjdPRmdZ/E2rGm 9JIrqJ2EBMqbHicL0riBAFF+0+jzqBQbebuNEyOWHAQaSBz2+pgYf2UjQQuP3Cn7vUVJ L1kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SjHvu6t6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz40si8280352ejb.432.2020.07.03.06.41.09; Fri, 03 Jul 2020 06:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SjHvu6t6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726573AbgGCNji (ORCPT + 99 others); Fri, 3 Jul 2020 09:39:38 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:47620 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726048AbgGCNje (ORCPT ); Fri, 3 Jul 2020 09:39:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593783573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EtLhU2i77FUsXNVo6j8K13haqXLSgGlY+OveqDaP62E=; b=SjHvu6t61KO3gOcrERoyu/WE5h0skCGm9V2Yb03idyEh3FGchE22hfXiXiQWQrz2GSr9KX MvNUOrL2X9ByEM5B36ychPkBCAZyYZHZb8RuJSuMZobERfVpgYcYrb8XqEsx0JkjOfxz27 PoMY7oVrYRg8aBKMYUK20KnEcG4TqIs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-405-6sH34XU6PR28k09ORBufAA-1; Fri, 03 Jul 2020 09:39:31 -0400 X-MC-Unique: 6sH34XU6PR28k09ORBufAA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 420861902EA8; Fri, 3 Jul 2020 13:39:30 +0000 (UTC) Received: from t480s.redhat.com (ovpn-114-0.ams2.redhat.com [10.36.114.0]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2AA67AC75; Fri, 3 Jul 2020 13:39:28 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-s390@vger.kernel.org, linux-mm@kvack.org, David Hildenbrand , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Gerald Schaefer Subject: [PATCH v1 4/9] s390/vmemmap: cleanup when vmemmap_populate() fails Date: Fri, 3 Jul 2020 15:39:12 +0200 Message-Id: <20200703133917.39045-5-david@redhat.com> In-Reply-To: <20200703133917.39045-1-david@redhat.com> References: <20200703133917.39045-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cleanup what we partially added in case vmemmap_populate() fails. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Gerald Schaefer Signed-off-by: David Hildenbrand --- arch/s390/mm/vmem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index 16e109c292bf5..bcddabd509da8 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c @@ -364,6 +364,8 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, } ret = 0; out: + if (ret) + vmemmap_free(start, end, altmap); return ret; } -- 2.26.2