From patchwork Tue Apr 2 14:24:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1918872 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=hskFWnFB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V89Fk3p3Tz1yZ4 for ; Wed, 3 Apr 2024 01:27:38 +1100 (AEDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrf5D-0001w4-0M; Tue, 02 Apr 2024 10:25:56 -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 1rrf56-0001lQ-Ud for qemu-ppc@nongnu.org; Tue, 02 Apr 2024 10:25:45 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rrf54-000063-RT for qemu-ppc@nongnu.org; Tue, 02 Apr 2024 10:25:44 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-34372e3db28so358309f8f.2 for ; Tue, 02 Apr 2024 07:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712067941; x=1712672741; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7qcHH+OAhHv5oWHUpWK7YMWCpNLvO0BPFhkfbb/3C2c=; b=hskFWnFBvkFPy8nFb1IeN2z+snIZBvs3k3PXE7OJ4wIUl+Cnl6LUze7nB3D9SRIFIm TvDcv0Tk64fLxcqiDjo6DZzaB3eE+XLqVayJdJBwdJWlEZXxm01tQQLXNL6P/57cw2Pv eaYwOpzuw4NgqHLbgKbUrCGMZ6y0Nj+XcxAY1oUhyA0k9moSoscOlATq9SjFrjGfKOuS MZpPFwGEI4lW+Vhsd680XjrAnWX5zj/mUD7N1U8bwTuIeR8OzBJPvjBRZiWWnZ0uj3NM fs1SNIjjgJ6XqhGQ9KqJ3gpRjMgOnxH3ZwB2ZEVsIgKi0Vc45AMkijSuWjZ9RmszWkUP rF8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712067941; x=1712672741; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7qcHH+OAhHv5oWHUpWK7YMWCpNLvO0BPFhkfbb/3C2c=; b=vYEeRBD4IFHqTnHQ9p1vvkU7Bd1Q6Qoc+w3Jt5Pj2EdLveBjrCCEUDeHd+ZtlEa2PP ishKvF2OFZypKA1uq1oCo5wgbnA3M7OPP90i3DhvZIuV99v768LdsfG1sa+Zf17E7XWI yYKHTlnv9j+0fE31hNQhguo9boCcTVzm/18hl5k9rhulxqoLf8Jl1FVXdGNgwZ11ilcX kws0LNjZjnreBUt6N3G9yZMa1F6JHWhMMLT4zTcHkIT+UjTNkzAmw8Ak4xSwO/40+AT+ /OHk8wWkfbZcI7YPrVoMBL6vF0Tq0nze2L/qqackSLjpjQrq3w+0l9jK0cWZ1xSyagD/ qizg== X-Gm-Message-State: AOJu0Yw0eM4Hk5nD55YCMWAT8zfftbEXiJJdjNhS3Oqe1gxE0sihDZLd VMAZbO58iYEHNezUcrBjRij7SiVCjB2cLs/vF6pjwJQ2s5CNOPSBEmTDTs2J2YY= X-Google-Smtp-Source: AGHT+IEXIE7qmPsir59JZH4f0PPcQyJ4KagaBvkKMFNWGMsHJ3uFs9sfwByBvLsTeGCD+W46V6Wgcw== X-Received: by 2002:adf:ca8b:0:b0:33e:7719:325d with SMTP id r11-20020adfca8b000000b0033e7719325dmr7135610wrh.2.1712067941079; Tue, 02 Apr 2024 07:25:41 -0700 (PDT) Received: from m1x-phil.lan ([176.187.202.91]) by smtp.gmail.com with ESMTPSA id az15-20020adfe18f000000b0034335f13570sm12328862wrb.116.2024.04.02.07.25.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Apr 2024 07:25:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-block@nongnu.org, qemu-arm@nongnu.org, Kevin Wolf , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Fiona Ebner , Stefan Hajnoczi , Fam Zheng , Hanna Reitz Subject: [PULL 10/15] block: Remove unnecessary NULL check in bdrv_pad_request() Date: Tue, 2 Apr 2024 16:24:25 +0200 Message-ID: <20240402142431.70700-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240402142431.70700-1-philmd@linaro.org> References: <20240402142431.70700-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Kevin Wolf Coverity complains that the check introduced in commit 3f934817 suggests that qiov could be NULL and we dereference it before reaching the check. In fact, all of the callers pass a non-NULL pointer, so just remove the misleading check. Resolves: Coverity CID 1542668 Signed-off-by: Kevin Wolf Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Fiona Ebner Message-ID: <20240327192750.204197-1-kwolf@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- block/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/io.c b/block/io.c index 395bea3bac..7217cf811b 100644 --- a/block/io.c +++ b/block/io.c @@ -1730,7 +1730,7 @@ static int bdrv_pad_request(BlockDriverState *bs, * For prefetching in stream_populate(), no qiov is passed along, because * only copy-on-read matters. */ - if (qiov && *qiov) { + if (*qiov) { sliced_iov = qemu_iovec_slice(*qiov, *qiov_offset, *bytes, &sliced_head, &sliced_tail, &sliced_niov);