Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3285033ybb; Tue, 31 Mar 2020 02:05:46 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt+vlbKYl8ko4wQkpMuTem1DY1hNYkqgxZjZJwR9gkeFHqCKFTrFFhNA6wNYxEhp60j2Vyi X-Received: by 2002:aca:d44d:: with SMTP id l74mr1389613oig.83.1585645546299; Tue, 31 Mar 2020 02:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645546; cv=none; d=google.com; s=arc-20160816; b=n8izdFYmFOXku0wI+anpI3VscIy+pgma8FKtYKcAfKzFoL9H3caaMYFhcOxzwkiyOy hcIVoLzHdZgNn3HyYe13VgaYppQ9pjqt9Ww902rT6EWnM+9hFAqqJEZN+KwkwLbOSZOI x9y5x5yXZhAMHHpmktuP1raa7osZCSxzDjzhfuoqztteqHZ5jAb9BvLqecXTNrpUJE38 2Zc/qvqAqK61HUtFXCwDgPxFwpE9t7DdxbCy2WtmMkWTN92Wiz3lMWdpXj8M5kwdfSxd Vjhr/vDHZ7VWgcglZPhZNxA52PlE+wLp4iTfwpcIBXZSBPs3GCKpXgmRuycPnZ96Zgwa ZcYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cvdk0FS8cb+HHfasshT3rovWv3qeoMHIfenAkqr9W94=; b=lSCltDNf4c+RKv1H+Z5yKK9JDbNhX3wi/cvbL9cXAEjPaOO4cvWh0n6/aoeLiUw+e/ y3jnsJTwLm8hSIaMZ4SejUl4l2IhdjI9SWQ1sIGe4etrrFPdmSRzKlhsxuorAQN/hmgC dDb9QBY7XlS5yQrZykqNQKgJY4tyr3fRhBagcOq8Smm9vrmMgn38TNUchfeE4CL2ljFV mjeO0czRE7jQBLl+PFyk8hk/yvORbzS7Kla8NOzBmclIFeyPjvOIJt9x5s09Q0xs1YQ/ S71FS5pTWa6zz/xrBG1fs2fuXRk7uiH5Sa3up44ESBKGD+t0v+TlI3W5yhmNo/ZsaLVZ gYwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=B8evKuMf; 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 h9si7466390otr.176.2020.03.31.02.05.34; Tue, 31 Mar 2020 02:05:46 -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; dkim=pass header.i=@kernel.org header.s=default header.b=B8evKuMf; 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 S1730673AbgCaJFF (ORCPT + 99 others); Tue, 31 Mar 2020 05:05:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:45882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730570AbgCaJFE (ORCPT ); Tue, 31 Mar 2020 05:05:04 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 2FC4520787; Tue, 31 Mar 2020 09:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645503; bh=NeubGs2Kg9duRgrqga3UHI//e9k9vjc8bZ8Y4TZt8vM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B8evKuMfHDfYTI4vEb+aYjvj8eh/4lV8iZQ6kTq+e3PX89r8RC9aQRrSMPCZXUtIS V+JKaZVREoCVlIdC8Fcp7UaRcjZE4Jy+1Y6rUHkiDxhi5RSAAd43+ntURO64QmtdMa LSaxmKr8O0WYvcYMUykyIuR82KWX26Wg+PyxbovY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, yangerkun , Oliver Hartkopp , "David S. Miller" Subject: [PATCH 5.5 035/170] slcan: not call free_netdev before rtnl_unlock in slcan_open Date: Tue, 31 Mar 2020 10:57:29 +0200 Message-Id: <20200331085427.768203682@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver Hartkopp [ Upstream commit 2091a3d42b4f339eaeed11228e0cbe9d4f92f558 ] As the description before netdev_run_todo, we cannot call free_netdev before rtnl_unlock, fix it by reorder the code. This patch is a 1:1 copy of upstream slip.c commit f596c87005f7 ("slip: not call free_netdev before rtnl_unlock in slip_open"). Reported-by: yangerkun Signed-off-by: Oliver Hartkopp Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/slcan.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/can/slcan.c +++ b/drivers/net/can/slcan.c @@ -625,7 +625,10 @@ err_free_chan: tty->disc_data = NULL; clear_bit(SLF_INUSE, &sl->flags); slc_free_netdev(sl->dev); + /* do not call free_netdev before rtnl_unlock */ + rtnl_unlock(); free_netdev(sl->dev); + return err; err_exit: rtnl_unlock();