From nobody Sun Feb 8 18:09:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599034000; cv=none; d=zohomail.com; s=zohoarc; b=LDpPxIYs8h1scAMESoROQdIkuvxXgAWvq2uVkh8uWq3YIK6QXlTheU6K6ilx57PEw0Rz6etDEF9hLQAfzGfKLlH36UOQPxij05IRTiN5hp3Gg9uw4DlatuyXK32kV0xIp2kZkz6/PBF1LiFEfCi2ZseNBmo5egF7BE3T4CLQRCw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599034000; 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=zUKO378qgEMw5DfWn5fjWQga9IMT5p6MgV6h7VpM6Fs=; b=oK225izDQ4N5xxzRlJf5CHtVtwcHKjFzOuMHjTfvip6GN06PNiL5TkN4ZIf08vJPQzyc3u50jLssN5T1gtZ0h2AcMz4n4ITdvu4ZOswtejSpSysjtcctbRoXiVOJJlIg4qMMln1BfceN/bvafLBcRfd77GYvtBbMKU+Z4WPHw+I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1599034000879202.74796682580347; Wed, 2 Sep 2020 01:06:40 -0700 (PDT) Received: from localhost ([::1]:33596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kDNmx-0004ZR-TN for importer@patchew.org; Wed, 02 Sep 2020 04:06:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDNmL-000459-Fx for qemu-devel@nongnu.org; Wed, 02 Sep 2020 04:06:01 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:29057 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kDNmJ-0001UW-SL for qemu-devel@nongnu.org; Wed, 02 Sep 2020 04:06:01 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-266-ao178VPbPHSbKJ8LkPQWLg-1; Wed, 02 Sep 2020 04:05:57 -0400 Received: by mail-wm1-f70.google.com with SMTP id b14so1297747wmj.3 for ; Wed, 02 Sep 2020 01:05:57 -0700 (PDT) Received: from localhost.localdomain (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id w15sm5874984wro.46.2020.09.02.01.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 01:05:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599033958; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zUKO378qgEMw5DfWn5fjWQga9IMT5p6MgV6h7VpM6Fs=; b=S1y67BRSX3kIOmNDDlM7VmqLNdOayQHKuQGJxXEe/D30+cS6dbYMEeo/flesyxUjnYTdU+ U9CjKyCtc01fNVS4SYI07bjQfc3+cw5AREZdQ4cNvjFhAvmd2CUl1UABsSJpf3L8qYjIwL puI2QudzJtdYjkFvS2wvEx4lZjkl/aU= X-MC-Unique: ao178VPbPHSbKJ8LkPQWLg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zUKO378qgEMw5DfWn5fjWQga9IMT5p6MgV6h7VpM6Fs=; b=M4zcb9bfwbfpgRzf7pVLrD+/PypDdQGYtEUXmwN0MF0vBIxg45gK0TY3voy/Fya6gz /uIFuBG09WBPSb855++vOZ2xS/eN4/iWRYgMxD/bqC2rpL7hDMEWky+NbBMZI/z5gMK6 Q1jhFAXBPnZZazh/hjRjOecAzNUxvD4ICWynYuRoXbeelfsQh5amgmd4tDwRXYYnQRvy LtkWnMZfK6q6XNSIiChGO1Ib1G1WGECEAmhefe5Yej00J6xO1ZXy75+q5CSmbKHY6LNP mFiJw5ckg+/PtUdtYOobz1NJyNEhkjrbHrCzSGtqLfWDHoBK1MPF9JIw07YJrYke8g3Z +YYg== X-Gm-Message-State: AOAM530zG/ExWTwOkVTwkuKw/dmcajriD8RMTXxCIraiXDX9bHjq/kTy j7jvhLkV1dAux3HoEQg/I/YoaRU4gBT6eUvkk9uTFWy/2esjcJHckj7p6BJUcoo75PuyukTnA3L MJ+xKEHFZS6VZcX4= X-Received: by 2002:adf:e7c8:: with SMTP id e8mr6214366wrn.358.1599033956219; Wed, 02 Sep 2020 01:05:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytJfqcUm/KS3NTrXzTxNWKpe1KkvD7PkR9NvSuxYaenth0xfVc8pGz6ARZuKgyXALclpd2Iw== X-Received: by 2002:adf:e7c8:: with SMTP id e8mr6214346wrn.358.1599033955948; Wed, 02 Sep 2020 01:05:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH] tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS) Date: Wed, 2 Sep 2020 10:05:52 +0200 Message-Id: <20200902080552.159806-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/02 02:26:30 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Fix an error handling issue reported by Coverity: /qemu/tests/qtest/ahci-test.c: 1452 in prepare_iso() 1444 int fd =3D mkstemp(cdrom_path); >>> CID 1432375: Error handling issues (NEGATIVE_RETURNS) >>> "fd" is passed to a parameter that cannot be negative. 1452 ret =3D write(fd, patt, size); Reported-by: Coverity (CID 1432375) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- tests/qtest/ahci-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/ahci-test.c b/tests/qtest/ahci-test.c index ca4294f44f3..5e1954852e7 100644 --- a/tests/qtest/ahci-test.c +++ b/tests/qtest/ahci-test.c @@ -1443,6 +1443,7 @@ static int prepare_iso(size_t size, unsigned char **b= uf, char **name) ssize_t ret; int fd =3D mkstemp(cdrom_path); =20 + g_assert(fd !=3D -1); g_assert(buf); g_assert(name); patt =3D g_malloc(size); --=20 2.26.2