Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1699003ybg; Wed, 29 Jul 2020 23:38:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+dbNjSD7SWGgd+AZMcrKtPuRhGS5PqaIiqv/Gmv1xHpoo7F8nO0wFRLARGa3owIO0/yWS X-Received: by 2002:a17:906:925a:: with SMTP id c26mr1154819ejx.121.1596091104914; Wed, 29 Jul 2020 23:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596091104; cv=none; d=google.com; s=arc-20160816; b=QVDDh+VpyeIqWwwEj8DWXnOvkHPijgv8mUyb/PZFL3F+sRUz8uVYYv2RV0B2c8itxM OpSdCqJsyEl8SCIY5aXUDu6SEA71EqUWceN/uLSX5aCz8CEjSNTtpBJpvKcjGvPUiRqq TYfeGALKmRVc2rBf6q7eZ+tk6Zq1WSegrrP65Emc0qqx9Px9qpiXJzT9loLxrLgexsDA v4KqMXzwlJuFsOEhDN8Er5txQ1JObKSliVLPg5lMa82jee4+YC5YqTTCWPdks2ApTbTg 4S0CTNDz5qU0tCCancrVawEEDkckmXAD/A8+nFrLhp8RQsnZRZhIVgQwrE3BrgA0bZ26 LPjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=8FRXaIdysTB/a8sWR7PMth3a1tzFUGPVg6ReqEyI6+8=; b=HRPE+dI9PYmpmDlz9T0Mtp4mv/JZ97HMIHg9Ah5ae//f6Ejr6H6fzRPkUgBWV2kIxV pNm2WdIt/I0LxbyGnVOhJCa3QcuiXSUyW7oekUftcBbKvRTk8rwZKovD5FlJhGdVTmg0 3Ck/dDsLbv9b9nKmKYVeTzNJWlP/5GrxXAiC1o91BtzU8rKcIsBmA39HExpEfDwb4fN1 O6yIhFw/S1NphR4PBTt6m2bXOdQX4aTm1s+rJnvLfCsCxLoKFzDe14C9kiYZfCiL4BcG libquLeYiw3JAAKyQkp0F9242Dczvh2lSXcGpSJuMkVqjURSfDfH7rPsuNetSZaKvp19 Abvg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn20si3914804ejc.111.2020.07.29.23.38.02; Wed, 29 Jul 2020 23:38:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726899AbgG3Ghv (ORCPT + 99 others); Thu, 30 Jul 2020 02:37:51 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8300 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725892AbgG3Ghv (ORCPT ); Thu, 30 Jul 2020 02:37:51 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id B002FC277C6F562E7155; Thu, 30 Jul 2020 14:37:46 +0800 (CST) Received: from huawei.com (10.175.113.133) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Thu, 30 Jul 2020 14:37:43 +0800 From: Wang Hai To: , , , , CC: , Subject: [PATCH] s390/test_unwind: fix possible memleak in test_unwind() Date: Thu, 30 Jul 2020 14:36:02 +0800 Message-ID: <20200730063602.31581-1-wanghai38@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.133] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org test_unwind() misses to call kfree(bt) in an error path. Add the missed function call to fix it. Fixes: 0610154650f1 ("s390/test_unwind: print verbose unwinding results") Reported-by: Hulk Robot Signed-off-by: Wang Hai --- arch/s390/lib/test_unwind.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/s390/lib/test_unwind.c b/arch/s390/lib/test_unwind.c index 32b7a30b2485..b0b12b46bc57 100644 --- a/arch/s390/lib/test_unwind.c +++ b/arch/s390/lib/test_unwind.c @@ -63,6 +63,7 @@ static noinline int test_unwind(struct task_struct *task, struct pt_regs *regs, break; if (state.reliable && !addr) { pr_err("unwind state reliable but addr is 0\n"); + kfree(bt); return -EINVAL; } sprint_symbol(sym, addr); -- 2.17.1