From nobody Tue Feb 10 17:08:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1501496992913541.2800981289373; Mon, 31 Jul 2017 03:29:52 -0700 (PDT) Received: from localhost ([::1]:58598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dc7xO-0001W8-Ss for importer@patchew.org; Mon, 31 Jul 2017 06:29:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dc7ur-0007q8-2d for qemu-devel@nongnu.org; Mon, 31 Jul 2017 06:27:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dc7uo-0001zW-Dt for qemu-devel@nongnu.org; Mon, 31 Jul 2017 06:27:13 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:38213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dc7uo-0001ye-5V; Mon, 31 Jul 2017 06:27:10 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 6EC0242ABC; Mon, 31 Jul 2017 13:27:09 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 535A3B81; Mon, 31 Jul 2017 13:21:45 +0300 (MSK) Received: (nullmailer pid 5563 invoked by uid 1000); Mon, 31 Jul 2017 10:21:45 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Mon, 31 Jul 2017 13:21:31 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 86.62.121.231 Subject: [Qemu-devel] [PULL 12/25] net/eth: fix incorrect check of iov_to_buf() return value X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Michael Tokarev , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 So we have sizeof(struct in6_address) !=3D sizeof(uintptr_t) and Clang > Coverity on this, see 4555ca6816c :) net/eth.c:426:30: warning: The code calls sizeof() on a pointer type. This = can produce an unexpected result return bytes_read =3D=3D sizeof(dst_addr); ^ ~~~~~~~~~~ net/eth.c:475:34: warning: The code calls sizeof() on a pointer type. This = can produce an unexpected result return bytes_read =3D=3D sizeof(src_addr); ^ ~~~~~~~~~~ Reported-by: Clang Static Analyzer Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Dmitry Fleytman Signed-off-by: Michael Tokarev --- net/eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/eth.c b/net/eth.c index 5b9ba26a56..ae5d881aae 100644 --- a/net/eth.c +++ b/net/eth.c @@ -423,7 +423,7 @@ _eth_get_rss_ex_dst_addr(const struct iovec *pkt, int p= kt_frags, rthdr_offset + sizeof(*ext_hdr), dst_addr, sizeof(*dst_addr)); =20 - return bytes_read =3D=3D sizeof(dst_addr); + return bytes_read =3D=3D sizeof(*dst_addr); } =20 return false; @@ -472,7 +472,7 @@ _eth_get_rss_ex_src_addr(const struct iovec *pkt, int p= kt_frags, opt_offset + sizeof(opthdr), src_addr, sizeof(*src_addr)); =20 - return bytes_read =3D=3D sizeof(src_addr); + return bytes_read =3D=3D sizeof(*src_addr); } =20 opt_offset +=3D optlen; --=20 2.11.0