From nobody Sun Apr 23 04:48:23 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q3wkb4mSJz46pZT; Sun, 23 Apr 2023 04:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q3wkb4H1xz3CjH; Sun, 23 Apr 2023 04:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682225303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e8W8tIn0g6FoCqS67v5PtLtm3Trss6YSsdSbwtZfP/U=; b=rsWtC+uLCXRdwrxMUx59/omPCgY4fcnIXpUEBq6jww3LxuOxbRkl4y0If4oMhQnPC1uUkf lDB69JFKRIk8CQjZvd7Oespqvvb/I8uWy7BOmwYnAdzhp9xq39BUy47T35HFnN3q9yediL yVnHYyOasa+srwJ5fuDNXyIOlll7m9F2tTCglbk8pAhkGgCU/fiOxigukBLDZJXWFF83Mz DD4NjCj/Us1ovgygPl4CAXHEH/HMbSd48ViLdKAtle6KxXJRTiEgAddjZcGwMz+goCuuL9 usvB5yjlVgHSMHgnsG4l8uKtt5a7gU9pewGBw46MWfRNe7hF1jv+pGZbkxbdGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1682225303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e8W8tIn0g6FoCqS67v5PtLtm3Trss6YSsdSbwtZfP/U=; b=ObZnmbkxpd7P7u+7cfbsfQL3vyvdVC3hgRApEjOiRmrLDV0Nx0DofwNvPCaq4/Ddj0d+z5 xlh2eARiAVsvIFBGUmY2YOY+Pbk0QAtMH1zge3dRHRr2OvmrJ5qljv9w6TsggsTwceMs7l coOsxgzwCK9HgYAXkISFkc6n7KlZQ+PdV7280X5Yn46L9of+K+58StNhrwWIhuSMih0x+G DnNc5sxScWu/Soux3qr/rGnlQSbF2nKRbNbgTAc5VAfaGLgKKtlCBl7K8asN7N/iZoz60q qEH0w7OhWjbAkDDuTpopPAbebrqvYtzyWR42QqFfH5xgWFk6/9Y5R18Uy1a6ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1682225303; a=rsa-sha256; cv=none; b=jvv2RqD8V4h0ZouVMq8RbAW0p+xov/XJwSnStzDZfLU77isfP8rj4iwik6a+pTsQ6pLrPj v2Jv/XHzIU3XcLTXVwHGvrlrURy3xpI6OAyj7jsELlodXLCp5IaqkKuhQW8YWl7yly4pqx BS8TbfLBw+ycYyFweWa0veUfbuRvnoOFOSGRExre/6xn7AK2iZudIeDaoTl4zvfNGprHKj oKPbpq7fHAl4V+k6IBJh+xofTd/WgUZVfk7PWgMel4BJmc/Dk0pAlDQnWzzjiCnvQkyjU0 Rx7Cce02y+alltXPH5wdZNcXZ+o1FVtOW8xKpOhG/mDIniimtVOprmhI+LyZXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q3wkb3PCVzVwq; Sun, 23 Apr 2023 04:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33N4mNam022706; Sun, 23 Apr 2023 04:48:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33N4mNZg022705; Sun, 23 Apr 2023 04:48:23 GMT (envelope-from git) Date: Sun, 23 Apr 2023 04:48:23 GMT Message-Id: <202304230448.33N4mNZg022705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: c373e1d6adbc - main - if_stf: Delete unreachable code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c373e1d6adbc3785e8f1072cdc4a062733baa514 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=c373e1d6adbc3785e8f1072cdc4a062733baa514 commit c373e1d6adbc3785e8f1072cdc4a062733baa514 Author: Zhenlei Huang AuthorDate: 2023-04-23 04:47:57 +0000 Commit: Zhenlei Huang CommitDate: 2023-04-23 04:47:57 +0000 if_stf: Delete unreachable code As the flag M_WAITOK is passed to ip_encap_attach(), then the function will never return NULL, and the following code within NULL check branch will be unreachable. No functional change intended. Reviewed by: kp Fixes: 6d8fdfa9d5e7d Rework IP encapsulation handling code MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39746 --- sys/net/if_stf.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index afc7b446fca7..5cb9a9d5c6dc 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -295,12 +295,6 @@ stf_clone_create(struct if_clone *ifc, char *name, size_t len, ifp->if_dunit = IF_DUNIT_NONE; sc->encap_cookie = ip_encap_attach(&ipv4_encap_cfg, sc, M_WAITOK); - if (sc->encap_cookie == NULL) { - if_printf(ifp, "attach failed\n"); - free(sc, M_STF); - ifc_free_unit(ifc, unit); - return (ENOMEM); - } ifp->if_mtu = IPV6_MMTU; ifp->if_ioctl = stf_ioctl;