Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2412872pxb; Fri, 29 Oct 2021 00:27:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm8LBqBw7oyRwK8fF9DmU7DQmDUphUm4HkxvEuYGWlIReUnfx4divGlV5WYeTZVLP7dUcR X-Received: by 2002:a65:508a:: with SMTP id r10mr6890874pgp.96.1635492423583; Fri, 29 Oct 2021 00:27:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635492423; cv=none; d=google.com; s=arc-20160816; b=WtqJKGMckcCM4CuSVFxFRcqJbu+bwqNkIbwS80Ny/oyLm9pfvHl1fiU1HhOqj9yngf yGgvwPZYaNd/QAvV6BQOoZBAk9v8NzDEELTkBr+0axeBq6rvkc+WgL91YGZrUW+k7G8q z6xcxPxLRcrY5p1EI7Xno8QuLNeMwYCHzTk7QrTqWZeW6Nwqzcgpc0FbzLbJVo2xKRKJ cbfpG0XxN2ZbcLuVeLbBua9YQS5/9wLFHgbU4hvKgIvUCsOq3tGy7S1obV/Lt+r0h//C H3eCszWZzZtU3WZcgd69laKbTMYdLM1aEjfoSlXesNZgmt7aBZmnE2ow1u9HBqN2hbOC p+BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=GlXWTC+ly6Ou+HZ4gxEdHU2FwWlri9nVtckWKDMYyFI=; b=qE/5kxQlfOSVjfhB+RK3EEnp26Q+2rxQgR1I0VvMBGcEXAQTMFip8seUnITbZSodTU UNGc7UA2rpkLHd6ENRjde5JTqrfXzU+TdKBGenNHYmBzEfVu5npzTESvIdimOowy5svx f48UD5Ty6vVxh7qYwrUa+XOr2X9bkmauDcLRGkVysMyCJcOMokwfc1vYfNOntwiOeFyZ VP0SLWW2D4tqEemyhDmSOEgUpHiicQ/HyblvFaEMvKG/WV0G4dbmTJQeXfGhgsE07Oli s3YBeTltmdATTbgkOAo/jZHQovbUO+Hoqe1rj0iGo0uDqFPpAObYQfQkLSETpBR3hsQb 4P8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Gqw9qzHd; 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 f14si8339240pfc.294.2021.10.29.00.26.50; Fri, 29 Oct 2021 00:27:03 -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=Gqw9qzHd; 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 S232221AbhJ2H1Y (ORCPT + 99 others); Fri, 29 Oct 2021 03:27:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25851 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232207AbhJ2H1X (ORCPT ); Fri, 29 Oct 2021 03:27:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635492295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=GlXWTC+ly6Ou+HZ4gxEdHU2FwWlri9nVtckWKDMYyFI=; b=Gqw9qzHdHCrb3oqUaCcArNMbhM8XId/9XRxkjm1Qta/kXfLa8s/tEx39ORUlrNMTZvZarB aH7VXE2kC23dXQafxhdU0DlYGtMJqGVku56k+dgg4XprOQcrntS1CtNsMIfgwfKrJPMDeq K1vgfHB7XpgS0KQvIEjS5VNxZhFkwos= 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-453-KKqqpD-hPViAh54vUL9fYQ-1; Fri, 29 Oct 2021 03:24:52 -0400 X-MC-Unique: KKqqpD-hPViAh54vUL9fYQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F169A8018AC; Fri, 29 Oct 2021 07:24:50 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-171.pek2.redhat.com [10.72.12.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id D378A5FC13; Fri, 29 Oct 2021 07:24:47 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, dyoung@redhat.com, akpm@linux-foundation.org, Baoquan He Subject: [PATCH 2/3] x86/kexec: remove incorrect elf header buffer freeing Date: Fri, 29 Oct 2021 15:24:23 +0800 Message-Id: <20211029072424.9109-3-bhe@redhat.com> In-Reply-To: <20211029072424.9109-1-bhe@redhat.com> References: <20211029072424.9109-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Before calling arch specific kexec_file loading function, the image instance has been initialized. So 'image->elf_headers' must be NULL. It doesn't make sense to free the elf header buffer in the place. So remove it. Signed-off-by: Baoquan He --- arch/x86/kernel/machine_kexec_64.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index fd8223fa2de5..dc8b17568784 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -373,9 +373,6 @@ void machine_kexec(struct kimage *image) #ifdef CONFIG_KEXEC_FILE void *arch_kexec_kernel_image_load(struct kimage *image) { - vfree(image->elf_headers); - image->elf_headers = NULL; - if (!image->fops || !image->fops->load) return ERR_PTR(-ENOEXEC); -- 2.17.2