From patchwork Wed Jul 31 14:36:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 815648 Delivered-To: patch@linaro.org Received: by 2002:a5d:4acf:0:b0:367:895a:4699 with SMTP id y15csp772980wrs; Wed, 31 Jul 2024 07:36:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW33Ks+e3AK1BrCo0ePC/y4rx32V60fIWUZgZk396H4ZV1Ia34dEoDksQSO00OuHZFVZmH0k3CyR/gGDWC9vnbf X-Google-Smtp-Source: AGHT+IGEAw6EJB2BgsMZISrRwAy34HGcGNDFSleifbItQTT03Sq4yy2w/UfecceEpzTvqm58TivI X-Received: by 2002:a05:6214:c6c:b0:6b0:743b:71f5 with SMTP id 6a1803df08f44-6bb55ac0ecfmr190748836d6.44.1722436613142; Wed, 31 Jul 2024 07:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722436613; cv=none; d=google.com; s=arc-20160816; b=W5YOpO6IHie4/uNXi69w47Ffd8LsTL1f/447Zok3/q4Zq3URX4i4vynnLR0/ye70xY SKXqovgQxIQb5wGkTLL3eLPIIXsiIN6wJ08bh5TEQKv3nUSd9VOEQhr8B1IVbUafn/FH UICvuUjHyu2sCQCLpAEQMKrEqr/dnMmD+qBGOW7CQs4ZMoD15Ht7V8QtGvYPxOdgmKP+ dvDFpCLZ08HSweRdZ7rqeP6P1lzSgtSh+VXgFtP6mce8DIC7DKSQtufD9k8kJ0L1DyHf MetCNVv2OQ6/M6kQaipL27+eMqrvV6SvorZW7R6N7y5sFrt7U+iRBADXrELU5NtqTopa X2Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=WJFK5vyGGdcL3oMdoUv5FkVPSRek6mnMGxS1HmBeMPU=; fh=5quBhmNe3tsEAdid5ZAgwbHv9gtP/oew6yvM24yBrbo=; b=MsqO4+TsMFit3juBv3i1ihnEh3Cr2qSXBKBSCqf0fYqt9IwdFgRuWBvoUV0o9v+PNb LrtSHBaShMGaNdsfrufE55U6SZzZhDDIhmQKSYFv12Gzqg7JnS74CPDIMB6WwcFYF/WE pBGW77uIuhc4C+fokLQRAyETW8CGVlL9SEVJbxUFRJpuJZik0i/WQKAEgqjtFx2Ejp+z G/j2hNfI7vnuy7yDQFX2XLb+By56oKo32umVQx28EI1g9OBMpRZr05oiZ+6scEhLde6a RTaPiw1PTXYQ9ISdpmidsjiAWckHBSiTUXK96OUxNLeagDu0ap8d45F6P/T8a9N+j5JI woqA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YRECnmuM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6bb3f8f00aesi158389646d6.168.2024.07.31.07.36.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 Jul 2024 07:36:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YRECnmuM; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZARG-0004SM-1X; Wed, 31 Jul 2024 10:36:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZARE-0004Qz-I3 for qemu-devel@nongnu.org; Wed, 31 Jul 2024 10:36:24 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sZARB-0002do-Pq for qemu-devel@nongnu.org; Wed, 31 Jul 2024 10:36:24 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2eeb1ba0468so90117981fa.0 for ; Wed, 31 Jul 2024 07:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1722436579; x=1723041379; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=WJFK5vyGGdcL3oMdoUv5FkVPSRek6mnMGxS1HmBeMPU=; b=YRECnmuMwu3WIwSAO3kbncYFifNhmgdSfdfFJlZxDI+6gHeJyfEqs7A2CdbKLuah32 ut0MOgsp6ZmuDkybtZP+OZb+ZqDNflEm+0mtssOJMw2bgyi2h+r7O7M0Wcy+mzoe7HIl 4YUIkQm9Ka0I82r4gP0LnPVBB2WAufGbrD+hekm/iyzSgcsBvQlI/ev2NWivtNuf2lTi /EgEXp59eKW9rD73CFn6C/hBCDTtAlK9YplTJYQGlBp1Fn0x+MZZEuKXeEEoFlPa/VE/ OIhShZMeC/nPfJPKgJIT9hZZ2lXzP6zv28e5UrErtqdzGOddfQwK9vyGdsVJn0MZr8su tMOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722436579; x=1723041379; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WJFK5vyGGdcL3oMdoUv5FkVPSRek6mnMGxS1HmBeMPU=; b=FOVr+MiWQFD2BLU7OgAjtQKZ9qYEqi9RCOmXVXGCkq+S99zn32TQHLFvUnY/O0dUjz dj2ejPhLX0lmm79Vt5saEYkFp3mvLoYYoY9szfB64VOqFIrpmYBTEFgI29uq31Q5fO+j i5i9PBBvU3zjagGqWrsa4Sm18aJIhBo1XPz8amw82XbbeKzyqvrwh8kLHNz7v2RMzY2M 8zzbDuCRZ8xt1FfKqOZkiO1+MPQAJeLLyLXl339eRcXIoSVfkuiFzSiSYdoBJuKrDsen bSXd58M4VyVdnxFyI3KqkG+uoOVy55tUKXFVjgmlV8VsfqjtdpZ6QfePA8VS8qu3avJB RjLw== X-Gm-Message-State: AOJu0Yxog2F94A7QoacWx+Nfyi5Q6v0SSsN+2qa4H3L7a3eLiNCO2jIm BnXasv6Flfauv64bArfs2v+Nt64HN/VHaQjW+VUQaPSo8BdiyvyEeoA8JCST7zjijpyIdpQQ9pk G X-Received: by 2002:a2e:9350:0:b0:2f0:2760:407c with SMTP id 38308e7fff4ca-2f12ee42005mr97876241fa.30.1722436578936; Wed, 31 Jul 2024 07:36:18 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4282b89a86dsm23976025e9.1.2024.07.31.07.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jul 2024 07:36:18 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , John Snow , Stefan Weil , "Richard W.M. Jones" , Hanna Reitz , Kevin Wolf , qemu-block@nongnu.org Subject: [PATCH 0/7] block: Miscellaneous minor Coverity fixes Date: Wed, 31 Jul 2024 15:36:10 +0100 Message-Id: <20240731143617.3391947-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=peter.maydell@linaro.org; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This patchset is a collection of fixes for minor Coverity reported issues. In all cases, there isn't a user-visible problem, but the Coverity issue pointed up somewhere where we could clean up the code or make it a bit more obvious to a human reader what the intent was. Only lightly tested (with "make check" and "make check-avocado"). thanks -- PMM Peter Maydell (7): block/vdi.c: Avoid potential overflow when calculating size of write block/gluster: Use g_autofree for string in qemu_gluster_parse_json() hw/block/pflash_cfi01: Don't decrement pfl->counter below 0 hw/ide/atapi: Be explicit that assigning to s->lcyl truncates hw/block/fdc-isa: Assert that isa_fdc_get_drive_max_chs() found something hw/ide/pci.c: Remove dead code from bmdma_prepare_buf() block/ssh.c: Don't double-check that characters are hex digits block/gluster.c | 6 +----- block/ssh.c | 10 ++++++---- block/vdi.c | 2 +- hw/block/fdc-isa.c | 2 ++ hw/block/pflash_cfi01.c | 1 + hw/ide/atapi.c | 2 +- hw/ide/pci.c | 4 ---- 7 files changed, 12 insertions(+), 15 deletions(-)