From nobody Wed May 8 00:58:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1584812125; cv=none; d=zohomail.com; s=zohoarc; b=WgNiXutNMUvP3n/zVt3ubzSMJAGX7pqxxgCOiBDMGsHlCHq1QMN51NcYLpyhJsVMtclQTftAUMzfMY/NqRTtU0F4DaqC7XlEtEkborWrsHwu/neeL4ihn1Fi4L7MJS+ZWihLZQm2hj/rHtcfDsYjxHl1up7u8MlukDg8O2Z6M9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584812125; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=llwfzrBGfeYzzgIRslkrFiI0vCORDEKy1umeySdSRd0=; b=c817l//mD8fpjYtSAyGUaPd86vq+RkPFL6xKdZJ5ZnNndIggKfXPnuCubLEGuyPiWLJ7iKmiUQovvHl25mcW9+fMMGpITXslj0iV28UXZuF/02XFiximWaYN8h8SwAFbBuFz78+KxXj4FTYZdzcYZoEIOBIH352UoMEekdK2M78= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584812125435322.07927793393856; Sat, 21 Mar 2020 10:35:25 -0700 (PDT) Received: from localhost ([::1]:39324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFi1r-0007vi-Vl for importer@patchew.org; Sat, 21 Mar 2020 13:35:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56335) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFi18-0007KP-48 for qemu-devel@nongnu.org; Sat, 21 Mar 2020 13:34:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFi17-0004iS-6m for qemu-devel@nongnu.org; Sat, 21 Mar 2020 13:34:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:62690 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jFi16-0004gH-Uj for qemu-devel@nongnu.org; Sat, 21 Mar 2020 13:34:37 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02LHXARc067959 for ; Sat, 21 Mar 2020 13:34:28 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ywesycp7t-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 21 Mar 2020 13:34:28 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 21 Mar 2020 17:34:26 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sat, 21 Mar 2020 17:34:24 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02LHYNsd51970144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 21 Mar 2020 17:34:23 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1319511C054; Sat, 21 Mar 2020 17:34:23 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CF93011C050; Sat, 21 Mar 2020 17:34:22 +0000 (GMT) Received: from bahia.lan (unknown [9.145.41.106]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sat, 21 Mar 2020 17:34:22 +0000 (GMT) Subject: [PATCH] spapr: Fix memory leak in h_client_architecture_support() From: Greg Kurz To: David Gibson Date: Sat, 21 Mar 2020 18:34:22 +0100 User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 x-cbid: 20032117-0028-0000-0000-000003E8E15C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032117-0029-0000-0000-000024AE42BA Message-Id: <158481206205.336182.16106097429336044843.stgit@bahia.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.645 definitions=2020-03-21_07:2020-03-20, 2020-03-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 mlxlogscore=851 adultscore=0 spamscore=0 clxscore=1034 phishscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 suspectscore=2 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003210104 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.158.5 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This is the only error path that needs to free the previously allocated ov1. Reported-by: Coverity (CID 1421924) Fixes: cbd0d7f36322 "spapr: Fail CAS if option vector table cannot be parse= d" Signed-off-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/spapr_hcall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 40c86e91eb89..0d50fc911790 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1726,6 +1726,7 @@ static target_ulong h_client_architecture_support(Pow= erPCCPU *cpu, } ov5_guest =3D spapr_ovec_parse_vector(ov_table, 5); if (!ov5_guest) { + spapr_ovec_cleanup(ov1_guest); warn_report("guest didn't provide option vector 5"); return H_PARAMETER; }