Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9079933pxu; Mon, 28 Dec 2020 06:09:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzI2W2yFERPJ80tCK6Jm0fTVjNrJNdeiEL4IzH7JhVrTY70yiZhiq7UHUO2iOwvkfy520CC X-Received: by 2002:a05:6402:6c9:: with SMTP id n9mr42378304edy.43.1609164582817; Mon, 28 Dec 2020 06:09:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164582; cv=none; d=google.com; s=arc-20160816; b=D8vklHcsq/9p+kZHSkjHfiy8DGBNmHBncFeP3LsyNYFmXhFnJ8ia/Z0QpYRtKnn56Y 5iD0B8/E8Xd6LPsyld6+CFDnEdHVKLLbu9uRbohF7K3hFWfqT5rFbON8oty7YPijXUvJ OiFrgPX0l9/Se6edBmhav+qy5V1H2NEJWo6ecuNMcyTZ3lBtw1rdhNewUEIzsCjrA7BU 0VF84wvhjwKDrxVmMY4oSu4OtBL6i/6clee6yqyUkmdnKtLYKpGARnMDx7O23nrHgi9E lCNS+/xgaUpz0GzJnfifjLnlfXPH06VxxqPP0Fg9iRLDnT2+KYeCmuRz7AMbnylrSfgK MQ2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Vj+be8QUKIgqWjXWHmkkjy5vYB9fkPKNmrJQo8SBhAw=; b=k3q/v9sPdAXcYuCV13HEKPAEwV7BQyEK180UN95eU6BdHbgxKwyhD7XKSNebpTwvIs wAN2GY/crqL9VxJyyQkwTcR2atNIkhkbYNOsCwsh+CxTkNmCDpGZcIeNcT+YIXPm2OjY T+xkCANeQuLiCjtE3AH7HL/VAnvp/sJ5GkHxq+v3tX44wTsfFbsN5hIXkDv+AJwgEcin RxCi5WBF+GHJgh9u4emidy/SrW3wLv290G+ybdqsm70gTRZ7NzxQR6K6Ke/cf5Lt2ab4 V0d6uBsGpk7wtHGBE3OJl9bAZoU0InhMDEBjW1gmQVvyisU+dIGiVCg2oxk/TlFYHUI7 F85A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KBLJ0cdI; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si20749567eds.453.2020.12.28.06.09.19; Mon, 28 Dec 2020 06:09:42 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=KBLJ0cdI; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391612AbgL1OHU (ORCPT + 99 others); Mon, 28 Dec 2020 09:07:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:40464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438069AbgL1OG1 (ORCPT ); Mon, 28 Dec 2020 09:06:27 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id E8149207B2; Mon, 28 Dec 2020 14:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164372; bh=yO7XlJK6PxR3jEhS1nQaNQfybxn9MgVaZEpaERMEYQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBLJ0cdIbZxrqYBZD7NGwJwY1KUGk4J78FOCncKMu0aObjQTfY2Fo5DK7bLyG1zqs 5dPw2cdMHa/eQECGIhUdUTRTTOZD3ragxDP67q2kSoOy0t+C812r90qa2WQvfmmOA6 Q7I4qAfbLIXuD+28uJZTbQvCJ9Q21W/BJc2j4LPw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhang Xiaoxu , Michael Ellerman , Sasha Levin Subject: [PATCH 5.10 158/717] Revert "powerpc/pseries/hotplug-cpu: Remove double free in error path" Date: Mon, 28 Dec 2020 13:42:36 +0100 Message-Id: <20201228125028.526401174@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhang Xiaoxu [ Upstream commit a40fdaf1420d6e6bda0dd2df1e6806013e58dbe1 ] This reverts commit a0ff72f9f5a780341e7ff5e9ba50a0dad5fa1980. Since the commit b015f6bc9547 ("powerpc/pseries: Add cpu DLPAR support for drc-info property"), the 'cpu_drcs' wouldn't be double freed when the 'cpus' node not found. So we needn't apply this patch, otherwise, the memory will be leaked. Fixes: a0ff72f9f5a7 ("powerpc/pseries/hotplug-cpu: Remove double free in error path") Reported-by: Hulk Robot Signed-off-by: Zhang Xiaoxu [mpe: Caused by me applying a patch to a function that had changed in the interim] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20201111020752.1686139-1-zhangxiaoxu5@huawei.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/pseries/hotplug-cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index a02012f1b04af..12cbffd3c2e32 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c @@ -746,6 +746,7 @@ static int dlpar_cpu_add_by_count(u32 cpus_to_add) parent = of_find_node_by_path("/cpus"); if (!parent) { pr_warn("Could not find CPU root node in device tree\n"); + kfree(cpu_drcs); return -1; } -- 2.27.0