From patchwork Wed Jan 5 16:45:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Leis X-Patchwork-Id: 12704524 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B16A2C433F5 for ; Wed, 5 Jan 2022 16:46:48 +0000 (UTC) Received: from localhost ([::1]:34602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n59R1-0008Jk-JB for qemu-devel@archiver.kernel.org; Wed, 05 Jan 2022 11:46:47 -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 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::b49 (failed) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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é 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 == 0) { vnet_hdr = tap_probe_vnet_hdr(fd, errp); if (vnet_hdr < 0) { + ret = -1; goto free_fail; } } else if (vnet_hdr != tap_probe_vnet_hdr(fd, NULL)) {