From patchwork Fri Oct 20 01:18:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 13429958 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5437117D3 for ; Fri, 20 Oct 2023 01:19:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TGp4afcy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71588C433C8; Fri, 20 Oct 2023 01:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697764740; bh=N7q0nY7TNQy4Cbw7fiBk47VxXEXIPG5CF+M3HOATVv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TGp4afcyqQXoXn81MK7TdHEb7geiCbOGTRA4opOIEaXg5SJQuB4cgHAJ+CYXEzqfs sK/uuz52mRbhWL3ePSSFUZeTZYjD2a8yHcdHMfHoFspSZdXnXFr5SDhSVruCQ34OQ7 EwhVfsFtyPJUN6rzZ+XjHSR+EyzSSqtd4yEs4HZgt2ocNoAFh4NYDBpKuHTKnO6unS SV3iQbHAiAENhtS2NjPx/bgKKVoaPKL7E3Pqwq0eKz7X52I7t1O6+z7PBt7Tzl37Lf 7fbuNfuGQkkNtYatgJS/GV6Y0zzWJauHdD974BdrWGRFmJdnFRGWfRbu173r3e2XJ3 Us1AkA8pzrxuA== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, johannes.berg@intel.com, mpe@ellerman.id.au, j@w1.fi, jiri@resnulli.us Subject: [PATCH net-next 5/6] net: remove dev_valid_name() check from __dev_alloc_name() Date: Thu, 19 Oct 2023 18:18:55 -0700 Message-ID: <20231020011856.3244410-6-kuba@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231020011856.3244410-1-kuba@kernel.org> References: <20231020011856.3244410-1-kuba@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org __dev_alloc_name() is only called by dev_prep_valid_name(), which already checks that name is valid. Signed-off-by: Jakub Kicinski Reviewed-by: Jiri Pirko --- net/core/dev.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index d2698b4bbad4..0830f2967221 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1077,9 +1077,6 @@ static int __dev_alloc_name(struct net *net, const char *name, char *res) struct net_device *d; char buf[IFNAMSIZ]; - if (!dev_valid_name(name)) - return -EINVAL; - /* Verify the string as this thing may have come from the user. * There must be one "%d" and no other "%" characters. */