Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1333974imm; Thu, 23 Aug 2018 01:00:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy5mXC55mdA9It3FNeY+016w+2cTuTv5PAmgwbsKVEHGFSl0P3X8r8aXK/n9/rUjqh427MS X-Received: by 2002:a62:aa02:: with SMTP id e2-v6mr61011965pff.211.1535011243665; Thu, 23 Aug 2018 01:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535011243; cv=none; d=google.com; s=arc-20160816; b=LZHYg4zvMv+o5FtNBgJTT9CEBD+TJBgfvmm85FabP9+yLAEbSdMMvK6QsBOtvziGl7 Y3Q76aT/mJl6QftLWMKtdON03k18HVwtQrpz1qsDCmE3IPbIBKtRz+cxSL9PB/v+SoRk wTjgRBm+Fq6IxuvC64lkHd8TAFECa8HxCGEVZFAc1PLrOb/HfF+iSawMLAEZ+3vSxhnd FoB0WV7y2ll0LyP9pXNeWtlaTIkh1Qs9BBX0xAOeu0pCrocCuYlWR57Ie1/c11Ah7f02 QVcivKJebygvirV/ycecJk2+qlofszN1abcqajsB+mElqRBF9qp4JKE9O1z8Vlj8WQKy TVVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=mW8HbZJv2JT0UP0Jw/mkRB2s/p6j+dRA+N4OZdjv79s=; b=HFMhtfjl0dNaQbCb96YQlkRTCIJKA5/nNvFGF2gYp/ZQumpvZUlx8F5hCeWDcp07HE P61T/xZGu7yF7SAXpFXLHlXJetEoOgyJmDrBuQ1Ok/8ENBOBrZmjgOkS0JkwoYG4Q4J2 150WbDS3SqXN46TsQvVYLbQnmsx179lNpt0lo/G75yY3ms6o2ImYGhHRY01u53bcmeHz o/7lpMjkLazcTnhpqKPcA0LvErL9/Vj/l7YyTBl4RMrkmNru6JnN47cp1zdu7gfeA6sk n5wr00eou7bhRVygCUgX0iAves/9vtxUhWS8CZoR+Ke5kKUyLcyLjuV12TCsWqcYdyxJ lzSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u15-v6si4276629pfa.28.2018.08.23.01.00.28; Thu, 23 Aug 2018 01:00:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728062AbeHWL0s (ORCPT + 99 others); Thu, 23 Aug 2018 07:26:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41802 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726898AbeHWL0s (ORCPT ); Thu, 23 Aug 2018 07:26:48 -0400 Received: from localhost (5355525A.cm-6-6b.dynamic.ziggo.nl [83.85.82.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2D4D89D2; Thu, 23 Aug 2018 07:58:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li RongQing , "David S. Miller" , Sasha Levin Subject: [PATCH 4.4 17/79] net: propagate dev_get_valid_name return code Date: Thu, 23 Aug 2018 09:52:53 +0200 Message-Id: <20180823074919.845164048@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180823074918.641878835@linuxfoundation.org> References: <20180823074918.641878835@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Li RongQing [ Upstream commit 7892bd081045222b9e4027fec279a28d6fe7aa66 ] if dev_get_valid_name failed, propagate its return code and remove the setting err to ENODEV, it will be set to 0 again before dev_change_net_namespace exits. Signed-off-by: Li RongQing Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/net/core/dev.c +++ b/net/core/dev.c @@ -7420,7 +7420,8 @@ int dev_change_net_namespace(struct net_ /* We get here if we can't use the current device name */ if (!pat) goto out; - if (dev_get_valid_name(net, dev, pat) < 0) + err = dev_get_valid_name(net, dev, pat); + if (err < 0) goto out; } @@ -7432,7 +7433,6 @@ int dev_change_net_namespace(struct net_ dev_close(dev); /* And unlink it from device chain */ - err = -ENODEV; unlist_netdevice(dev); synchronize_net();