From: Christophe JAILLET Date: Sat, 8 Jul 2017 08:40:13 +0000 (+0200) Subject: mrf24j40: Fix en error handling path in 'mrf24j40_probe()' X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=98b5798499b6614963e693dff5262de8d33b2cd0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mrf24j40: Fix en error handling path in 'mrf24j40_probe()' If this check fails, we must release some resources as done everywhere else in this function before returning an error code. Signed-off-by: Christophe JAILLET Acked-by: Alan Ott Signed-off-by: Marcel Holtmann --- diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c index 7d334963dc08..ee7084b2d52d 100644 --- a/drivers/net/ieee802154/mrf24j40.c +++ b/drivers/net/ieee802154/mrf24j40.c @@ -1330,7 +1330,8 @@ static int mrf24j40_probe(struct spi_device *spi) if (spi->max_speed_hz > MAX_SPI_SPEED_HZ) { dev_warn(&spi->dev, "spi clock above possible maximum: %d", MAX_SPI_SPEED_HZ); - return -EINVAL; + ret = -EINVAL; + goto err_register_device; } ret = mrf24j40_hw_init(devrec);