Received: by 10.192.165.148 with SMTP id m20csp791320imm; Fri, 27 Apr 2018 07:34:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr1wF0JXNLMqFVejGrVr0Sy9r32YZqSQpCkWo7JM5dNrsNKzEsV4wzLtFeAVJpTqYh0PfFh X-Received: by 2002:a63:3286:: with SMTP id y128-v6mr2399097pgy.419.1524839692892; Fri, 27 Apr 2018 07:34:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524839692; cv=none; d=google.com; s=arc-20160816; b=bu3sifLDcKg9mi6RRyooEzs/80WfWHSUEIeGW8pbqaOqzi7YplOh/O0oSFIth+4pSm GJQdkK5wow1Xw3K5ok9s3bYL1CtgQ8U7wXFKOcj8mZ+GN3y1u0jopRY/tY9Ve6uETLPV bTGudHJ++g1N3/qgacGCZfDHzv9ecBdkq2YaUP6hG2ioMULHsiGZ+Lxn15tikk8lR/lC 7JX33DeKfRIELn8ZpkffYolyh4wbEtX2sscp+I33OVK8h3R9OT2EEIGi9lXC10Bu3/KI A+mFqJEsMQ22EZ5rBRF0tf0GHlWNa29SK6XPlDkLi911JSB/sVcbVi5gDOBgVh8oahQ9 5www== 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:dmarc-filter :arc-authentication-results; bh=lNCj2c8jBm457/JXSx7UlKaAh/EotAn2L1cw54wYZ88=; b=PUwiteruJ1zr4pbp3BM/+PN6uVYNc6VLiNfHfKX9X9HYAe5ukDDCmjou9HW2XOzru1 y8JeIlHKQZ2J9M+kvMclBATohnI+HB1l48nr/6NFfOdofXzCSpOIXo1/8ZsAqpgS22U8 4PKFR/lodalV1ueJTJccBPvi3AnkKEb+Foep8LGQijKNmHCyzV8f1QPtDUM8tqwfAiPn O4L+klHqpATGGgh4NNLGphYy9IZR+j1AJlXDQKQjaCcTEXAze7JFf9ov+JJ8iUkaoUv3 DOEVnhvsw+W5BX5EmdcECP3n36/OR5+iWURGIiERqe3EcIcRDoUOt8Yt2XtxO1voUfOf nRkQ== 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 92-v6si1322794pli.455.2018.04.27.07.34.38; Fri, 27 Apr 2018 07:34:52 -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 S934910AbeD0Odc (ORCPT + 99 others); Fri, 27 Apr 2018 10:33:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:55420 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934811AbeD0OKQ (ORCPT ); Fri, 27 Apr 2018 10:10:16 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1A26021864; Fri, 27 Apr 2018 14:10:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A26021864 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Laura Abbott , Dan Carpenter , Sabrina Dubroca , "David S. Miller" Subject: [PATCH 4.16 23/81] Revert "macsec: missing dev_put() on error in macsec_newlink()" Date: Fri, 27 Apr 2018 15:58:25 +0200 Message-Id: <20180427135744.539038833@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135743.216853156@linuxfoundation.org> References: <20180427135743.216853156@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.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dan Carpenter [ Upstream commit bd28899dd34f9283c567f7eeb31bb546f10820b5 ] This patch is just wrong, sorry. I was trying to fix a static checker warning and misread the code. The reference taken in macsec_newlink() is released in macsec_free_netdev() when the netdevice is destroyed. This reverts commit 5dcd8400884cc4a043a6d4617e042489e5d566a9. Reported-by: Laura Abbott Fixes: 5dcd8400884c ("macsec: missing dev_put() on error in macsec_newlink()") Signed-off-by: Dan Carpenter Acked-by: Sabrina Dubroca Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/macsec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -3277,7 +3277,7 @@ static int macsec_newlink(struct net *ne err = netdev_upper_dev_link(real_dev, dev, extack); if (err < 0) - goto put_dev; + goto unregister; /* need to be already registered so that ->init has run and * the MAC addr is set @@ -3316,8 +3316,7 @@ del_dev: macsec_del_dev(macsec); unlink: netdev_upper_dev_unlink(real_dev, dev); -put_dev: - dev_put(real_dev); +unregister: unregister_netdevice(dev); return err; }