From patchwork Tue May 15 18:27:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 135925 Delivered-To: patches@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1377664lji; Tue, 15 May 2018 11:27:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr6rN6cYTr3dF6d62FMazX4O2qWjcYtoFqV4TtjRreKZUePTuZ5W95Io/ozqGqSpvO4cfej X-Received: by 2002:a1c:d53:: with SMTP id 80-v6mr9317961wmn.138.1526408822632; Tue, 15 May 2018 11:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526408822; cv=none; d=google.com; s=arc-20160816; b=ZSjOLQTw9GWks9CpDmJnFpOdbCuMmrowOyljFwrWgEfrRABjJ8vGnrkzx6bFjc3ISf LiHoyhJKO/mFCN4tnykbuyW18bR/+B2WFg7wmtSqDsIzTmGgFDPVLba3rWaR+/lL5Wjd laQBJtP6Tbq54yfRE0xD4Ai+XBQ0meyPGrbjQrRWgRjJtJGV4+2weQvs6QuVULBwZaGX 1KjJTuDuDmdfNPDrrwdbb6I9cG3+0yCiIyt5CRU7hOrUWJaJkUs0c6iiDqaQbp/aGkm5 fglLxp/89D3qlbfbT2JZGbUHJaen1S582Tl93/bi5/7cVB36m5zBIWb323k2hS4AJtKa UgLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=TcXPNktQVjUB7NeTEJLxaxQsFZU52Dtdw4BHZuom6VE=; b=c8cPH4CXIH3sk1RbIabudBt1/f9fc4p3yGLkAeD1eJriE9qR+cPqYsFJPZb3/5Y4vi hg6W7Jm6MrlsLFaV8Ir0coTx1TZUyFDVR/twIZbIG5h3JVPHkt/9wcjysbuzjxxnrEK5 ntfE0yU6S+5X5dlbSaudqk3JMxfYChvKCr4Y6ZWsQrwvXp4MTjFoqILdr78SlZ/i8EKm SFEpgMs7Eagg1kI6l2F32r2CJwh6H8pJYAzFRKXMHUFFPihHWK1kvK0yGkEIwz9vbNdG ZcRpyLjN7qW8IP0tyiKhUn0rQGVxMPII/0Xca7kTJJL6z7YjFXHrqMNCj7fNDLuEp8ui fcSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id m129-v6si673381wma.95.2018.05.15.11.27.02 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 11:27:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fIef7-0001iL-Gh; Tue, 15 May 2018 19:27:01 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Paolo Bonzini Subject: [PATCH] exec.c: Initialize sa_flags passed to sigaction() Date: Tue, 15 May 2018 19:27:00 +0100 Message-Id: <20180515182700.31736-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 Coverity points out that in the user-only version of cpu_abort() we call sigaction() with a partially initialized struct sigaction (CID 1005351). Correct the omission. Signed-off-by: Peter Maydell --- exec.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.0 Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé diff --git a/exec.c b/exec.c index ffa1099547..bd8833fc9d 100644 --- a/exec.c +++ b/exec.c @@ -1124,6 +1124,7 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) struct sigaction act; sigfillset(&act.sa_mask); act.sa_handler = SIG_DFL; + act.sa_flags = 0; sigaction(SIGABRT, &act, NULL); } #endif