From patchwork Mon Sep 14 12:34:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 1363560 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bqm7L0G5Cz9sTK for ; Mon, 14 Sep 2020 22:36:14 +1000 (AEST) Received: from localhost ([::1]:35244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHniN-0006Si-Vq for incoming@patchwork.ozlabs.org; Mon, 14 Sep 2020 08:36:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHnhY-0006SW-27 for qemu-devel@nongnu.org; Mon, 14 Sep 2020 08:35:20 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:31930) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kHnhW-0000Zi-9r for qemu-devel@nongnu.org; Mon, 14 Sep 2020 08:35:19 -0400 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-334-LCyeZRnMPoCPDQ9v4JImlA-1; Mon, 14 Sep 2020 08:35:09 -0400 X-MC-Unique: LCyeZRnMPoCPDQ9v4JImlA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 09B621021D23; Mon, 14 Sep 2020 12:35:08 +0000 (UTC) Received: from bahia.redhat.com (ovpn-112-218.ams2.redhat.com [10.36.112.218]) by smtp.corp.redhat.com (Postfix) with ESMTP id 518021002D52; Mon, 14 Sep 2020 12:35:06 +0000 (UTC) From: Greg Kurz To: qemu-devel@nongnu.org Subject: [PATCH 00/15] spapr: Error handling fixes and cleanups (round 2) Date: Mon, 14 Sep 2020 14:34:50 +0200 Message-Id: <20200914123505.612812-1-groug@kaod.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=groug@kaod.org X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: kaod.org Received-SPF: softfail client-ip=205.139.111.44; envelope-from=groug@kaod.org; helo=us-smtp-delivery-44.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/14 08:35:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action 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: Greg Kurz , Vladimir Sementsov-Ogievskiy , qemu-ppc@nongnu.org, Markus Armbruster , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Yet another round of sanitizing the error handling in spapr. I've identified locations that needed fixing with the errp-guard.cocci coccinelle script. It turns out that a better result is achieved by fixing manually, especially by converting some void functions to indicate success/failure with a return value. Greg Kurz (15): spapr: Fix error leak in spapr_realize_vcpu() ppc: Add a return value to ppc_set_compat() and ppc_set_compat_all() ppc: Fix return value in cpu_post_load() error path spapr: Simplify error handling in callers of ppc_set_compat() spapr: Get rid of cas_check_pvr() error reporting spapr: Simplify error handling in do_client_architecture_support() spapr: Simplify error handling in spapr_vio_busdev_realize() spapr: Add a return value to spapr_drc_attach() spapr: Simplify error handling in prop_get_fdt() spapr: Add a return value to spapr_set_vcpu_id() spapr: Simplify error handling in spapr_cpu_core_realize() spapr: Add a return value to spapr_nvdimm_validate() spapr: Add a return value to spapr_check_pagesize() spapr: Simplify error handling in spapr_memory_plug() spapr: Simplify error handling in spapr_memory_unplug_request() include/hw/ppc/spapr.h | 4 +- include/hw/ppc/spapr_drc.h | 2 +- include/hw/ppc/spapr_nvdimm.h | 4 +- target/ppc/cpu.h | 4 +- hw/ppc/spapr.c | 76 ++++++++++++----------------------- hw/ppc/spapr_caps.c | 7 +++- hw/ppc/spapr_cpu_core.c | 24 +++++------ hw/ppc/spapr_drc.c | 17 ++++---- hw/ppc/spapr_hcall.c | 34 +++++++--------- hw/ppc/spapr_nvdimm.c | 24 +++++------ hw/ppc/spapr_pci.c | 5 +-- hw/ppc/spapr_vio.c | 12 +++--- target/ppc/compat.c | 26 +++++++----- target/ppc/machine.c | 9 +++-- 14 files changed, 108 insertions(+), 140 deletions(-)