Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2593795ybg; Fri, 31 Jul 2020 04:54:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw08hXGzMgx6qBIAyMKBKGYsS5J9aA4d5Q4OGEZ7aCGLZiWxDNkmwXNlO4yJMRkibDu5tYj X-Received: by 2002:aa7:c6c2:: with SMTP id b2mr3620703eds.173.1596196457844; Fri, 31 Jul 2020 04:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596196457; cv=none; d=google.com; s=arc-20160816; b=NqL/M5NO2+KNOuFAeuZ2elWx4kozvCGgM8VFff06bJMNLnhxTvc4s+h7WCujCUJCZk nUq+4Jm29L9sWoAs2KrakauiCqsc0+qMRdFRM7PPrb8WCauagIcMHLf0nak3Il7tkxOt C9pRSKSdoiwSMbE7nCzj3Kjs3/zlOgV947NBZEh6Cd9Y41ZxkLM9EtIVFp3/fOhB2q6o EM1ZillBI+1+I9ka6OA99kDm22p5ecCVMi6Q4KmeWLKgjHgPyGDtuJTxa1M+L6+j34sj XGhtgNkgRsXFfBoBqhkDyt+XAs/QLqsrXG7Fn24YEQ5E/6JXxxpm+wSvfHwZxOyaJCDP E47Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ibS1IbJyjitrTQbRHlZLAzl6KHUstdq2JVvTDhfc94o=; b=rkO221UmbivhrQ6LEwc2bMQou8O87t6+mQpVI5VYe9bcK7t5ywFoqeYg8/NOT8J67l a7WLt7JFi1kQMxPoNbyrdQuCg3Hi3tUz0MPrk18sPIId9qmXt2OTs4fJoL1RldyWqV9Y Hpf/79yfRvnWxBw0+jXmutnzrfliK9gEP9GqUX8r+RbgyeCZPJCFzPCwhAaat0GD+Wa6 uGDmUTp2WPatdFH7VMWZUaTMHj679zDi5Id8inZsYjR5MlEs3jzoxxuWOFJRREddhot6 BH0ZXi8x9gKR18hJD/qJ6IdGp1Fk74P7eKeyxRPFLMikSW8hcS2q2+TeNd3LqDSsKc2o Q9Qg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr22si4817402ejb.739.2020.07.31.04.53.54; Fri, 31 Jul 2020 04:54:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732776AbgGaLwp (ORCPT + 99 others); Fri, 31 Jul 2020 07:52:45 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:6314 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732690AbgGaLwp (ORCPT ); Fri, 31 Jul 2020 07:52:45 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06VBWwbk067877; Fri, 31 Jul 2020 07:52:33 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 32md200pwu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Jul 2020 07:52:32 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06VBkT35025791; Fri, 31 Jul 2020 11:52:31 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06ams.nl.ibm.com with ESMTP id 32gcqgq6un-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 31 Jul 2020 11:52:31 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06VBqSKM61735376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Jul 2020 11:52:28 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 54AC2A4057; Fri, 31 Jul 2020 11:52:28 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ED0EDA4051; Fri, 31 Jul 2020 11:52:27 +0000 (GMT) Received: from osiris (unknown [9.171.43.11]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 31 Jul 2020 11:52:27 +0000 (GMT) Date: Fri, 31 Jul 2020 13:52:26 +0200 From: Heiko Carstens To: Ilya Leoshkevich Cc: Wang Hai , gor@linux.ibm.com, borntraeger@de.ibm.com, colin.king@canonical.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] s390/test_unwind: fix possible memleak in test_unwind() Message-ID: <20200731115226.GD11581@osiris> References: <20200730063602.31581-1-wanghai38@huawei.com> <247044acbf1dbae8e3b48c2dcc1457cd2e59cfef.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <247044acbf1dbae8e3b48c2dcc1457cd2e59cfef.camel@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-31_04:2020-07-31,2020-07-31 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 spamscore=0 clxscore=1011 priorityscore=1501 malwarescore=0 mlxlogscore=777 adultscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=1 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007310088 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 30, 2020 at 09:35:15AM +0200, Ilya Leoshkevich wrote: > On Thu, 2020-07-30 at 14:36 +0800, Wang Hai wrote: > > 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); > > Looks good to me, thanks! > > Acked-by: Ilya Leoshkevich Applied, thanks!