From nobody Mon Apr 29 12:36:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=reject dis=none) header.from=google.com ARC-Seal: i=1; a=rsa-sha256; t=1641401220; cv=none; d=zohomail.com; s=zohoarc; b=n8vXVOQRAY6LolpCByOFUMzQp501lXvWOiz+gkPrRMFG43dkJza08Jk2RlOC9J6VW0gVygeFkq0LKYF2GST5HJEedhfoZ6ogIt0FgNYrsw/Al58Tjxb6Sxt6j2bEoycaXKQH2flnrgDRsFDcJbul7dfAhVIo/j+Dyfspi1smiQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641401220; 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=VuBzE8dIuy1MwqUjC3TAArH5pVL/fBClNJZpGS4Jo1M=; b=Ev5K6yg4cPe4pWtldrwFbuaSemH5oN5Dx7yFT8Ob2G/mRCRQjpTyYscVAQp0tJGpiSNigJWpep/S0gURZXag/nbnMtP7r6zSy/8Js6ie0EbwcwJ6GRIeWGDHG1VYRY6cy6vaae9DFCWz52qB5O328qkm1cJ6Htlpj6XRN+dv9nw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641401220494354.75878661135494; Wed, 5 Jan 2022 08:47:00 -0800 (PST) Received: from localhost ([::1]:34602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n59RB-0008Jk-O5 for importer@patchew.org; Wed, 05 Jan 2022 11:46:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <3D8vVYQcKChIDw5BC9wy66y3w.u648w4C-vwDw3565y5C.69y@flex--venture.bounces.google.com>) id 1n59Pk-0007bv-VS for qemu-devel@nongnu.org; Wed, 05 Jan 2022 11:45:32 -0500 Received: from [2607:f8b0:4864:20::b49] (port=39859 helo=mail-yb1-xb49.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <3D8vVYQcKChIDw5BC9wy66y3w.u648w4C-vwDw3565y5C.69y@flex--venture.bounces.google.com>) id 1n59Ph-0002xb-N5 for qemu-devel@nongnu.org; Wed, 05 Jan 2022 11:45:27 -0500 Received: by mail-yb1-xb49.google.com with SMTP id k130-20020a255688000000b0060c3dcae580so53300781ybb.6 for ; Wed, 05 Jan 2022 08:45:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=VuBzE8dIuy1MwqUjC3TAArH5pVL/fBClNJZpGS4Jo1M=; b=kJ9m0oHuPSaHBZTczuXTuiV9ifwWPHsR1KfwqFy3L3xKirr2J3UqonkHHw5OmU/Znj YEq7LBl1tXka2NioblDvTGWibsZuCz9iBvP1ve8Qk/aK+Vv5Os4b1twJIMit+40hSuZK 4bhjpoVmPvhGhxUIKikGqyHGzn2uiUqUdAowJy9af5heoOaZU9iif4YRuKfXpHOps2K3 DPPl48haYHaUgMWX6Y/nKTLLcdOqncMfjTClLR/xkaZGvRmPQtQUTdk8ONsSqONa7deV Wf994fFZ/15kD11riyVLvgFAR680CIKD/Fq6RtIDh2oDZycSCaYGYLuPn5yFKxfEguLH xFMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=VuBzE8dIuy1MwqUjC3TAArH5pVL/fBClNJZpGS4Jo1M=; b=lHlrCfoPFO7sjsQjKn8ZjESy5S0F6YDteoZnHZHK0MSUs4MqoiLgektGflhOUMpcB4 /Bndhr7I2Le59qzKONV4y8Ei5NQo/lhsiJ2h3KBD/smJSM1numjUrlj60PJYfTPvqV/a gXcBc9QwnmkgYofofv6vEpQGghqcqzj38q3ChCN3/KuCijFGtC38e+dyu2Rfag0MWa49 FRiSUNw5pRHdWv0ebBDT6a/hGRQ5EbVUGL51BPyHugmP1zoTX4Xwsyv+lc7Ik93j+hVd +w+ONDSje73fJZAZMTG0fuJ1pC4fMnXTBl4FKHZLI4D0TeuWsECL6VSZVz7llDP8WTuD HTVw== X-Gm-Message-State: AOAM532TXpGodcbUNHccTIp3M9AAVNH39OJbR90Dw63Td++2V0REp1t4 EP2/0CjQhzgTOeX80BuysGMff4d+ndrd X-Google-Smtp-Source: ABdhPJwyg20JHn/7CwNbroWazfNBynzbONNKK9QbLgOfbpDi4rAqgQn0KR049qpLDhdEIpQ1zrve14El2syV X-Received: from venture.svl.corp.google.com ([2620:15c:2a3:200:9017:ad23:15fc:8efc]) (user=venture job=sendgmr) by 2002:a25:d711:: with SMTP id o17mr53459482ybg.689.1641401103620; Wed, 05 Jan 2022 08:45:03 -0800 (PST) Date: Wed, 5 Jan 2022 08:45:00 -0800 Message-Id: <20220105164500.3381822-1-venture@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.34.1.448.ga2b2bfdf31-goog Subject: [PATCH v2] net/tap: Set return code on failure From: Patrick Venture To: f4bug@amsat.org, jasowang@redhat.com, pefoley@google.com Cc: qemu-devel@nongnu.org, Patrick Venture Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::b49 (failed) 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=2607:f8b0:4864:20::b49; envelope-from=3D8vVYQcKChIDw5BC9wy66y3w.u648w4C-vwDw3565y5C.69y@flex--venture.bounces.google.com; helo=mail-yb1-xb49.google.com X-Spam_score_int: -87 X-Spam_score: -8.8 X-Spam_bar: -------- X-Spam_report: (-8.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5 autolearn=no 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @google.com) X-ZM-MESSAGEID: 1641401221340100001 Content-Type: text/plain; charset="utf-8" From: Peter Foley Match the other error handling in this function. Fixes: e7b347d0bf6 ("net: detect errors from probing vnet hdr flag for TAP = devices") Reviewed-by: Patrick Venture Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Peter Foley --- v2: Fixed commit titlewq and updated description. --- net/tap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/tap.c b/net/tap.c index f716be3e3f..c5cbeaa7a2 100644 --- a/net/tap.c +++ b/net/tap.c @@ -900,6 +900,7 @@ int net_init_tap(const Netdev *netdev, const char *name, if (i =3D=3D 0) { vnet_hdr =3D tap_probe_vnet_hdr(fd, errp); if (vnet_hdr < 0) { + ret =3D -1; goto free_fail; } } else if (vnet_hdr !=3D tap_probe_vnet_hdr(fd, NULL)) { --=20 2.34.1.448.ga2b2bfdf31-goog