]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: lan966x: remove debugfs directory in probe() error path
authorHerve Codina <herve.codina@bootlin.com>
Mon, 13 May 2024 11:18:53 +0000 (13:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2024 07:48:43 +0000 (09:48 +0200)
commit1cdfafc256564b179c70e9b84549d002ae0799da
tree187b653cefebd576eac6fb3121025a4f7425d717
parentb0a82ebabbdc4c307f781bb0e5cd617949a3900d
net: lan966x: remove debugfs directory in probe() error path

commit 99975ad644c7836414183fa7be4f883a4fb2bf64 upstream.

A debugfs directory entry is create early during probe(). This entry is
not removed on error path leading to some "already present" issues in
case of EPROBE_DEFER.

Create this entry later in the probe() code to avoid the need to change
many 'return' in 'goto' and add the removal in the already present error
path.

Fixes: 942814840127 ("net: lan966x: Add VCAP debugFS support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/microchip/lan966x/lan966x_main.c