From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1D052D5412; Wed, 3 Dec 2025 16:16:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764778562; cv=none; b=swqTW0TALV0WTQt2LVxxxnCfqEwHJKS/Q8aYVvto1poT4jbieI2JqqhsvGZqJ8CaKAaFSnrHXjAGi0UIR3BeeRiMtT+b6W9UUErpRyYfD0QFm54Fb9eYPsVhlfVijtxpwbG9vr3JAexwnWmpuRywSQmd7Up7kMVamY7bKj27p70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764778562; c=relaxed/simple; bh=JQsNU53MhKtG78vxrPYFurcgMZNDMCYnjaF6TUEXJ00=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Lmpnu+JUbrJhvKTLOqs9tkoyt5ijbZzS2E6YsElmsXfV9VtzzuQLJgl0nbJgKAQ+Hid8yxhYW7cn3VXgA0dFS4pUtravHygSX46Peb70Jjxxcvb8icP5b4By1EvCHoOAXgPXx+yZcT2nd19UpY4gBkDqLcOi1C1V+3pZq0p4eMc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=MqT8WrFe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="MqT8WrFe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22049C116C6; Wed, 3 Dec 2025 16:16:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764778562; bh=JQsNU53MhKtG78vxrPYFurcgMZNDMCYnjaF6TUEXJ00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MqT8WrFeXLZa4Fph4zPqY+8hLneAxuPT+TC7iMZZujekRZTtKGy/FHWDSABDiOVna aFONViogpmJc5XKZMCkSj0aODf50tqRqAjiMEcNIJxVOu0Bm4RU4OFEnZxF7PrMqN1 bvvjW4UidQ4iFQYhl3LvUVaWZVclnLWmDl9QO420= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christophe JAILLET , =?UTF-8?q?Nuno=20S=C3=A1?= , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 5.15 351/392] iio:common:ssp_sensors: Fix an error handling path ssp_probe() Date: Wed, 3 Dec 2025 16:28:21 +0100 Message-ID: <20251203152427.082465155@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251203152414.082328008@linuxfoundation.org> References: <20251203152414.082328008@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe JAILLET commit 21553258b94861a73d7f2cf15469d69240e1170d upstream. If an error occurs after a successful mfd_add_devices() call, it should be undone by a corresponding mfd_remove_devices() call, as already done in the remove function. Fixes: 50dd64d57eee ("iio: common: ssp_sensors: Add sensorhub driver") Signed-off-by: Christophe JAILLET Reviewed-by: Nuno Sá Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/common/ssp_sensors/ssp_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/iio/common/ssp_sensors/ssp_dev.c +++ b/drivers/iio/common/ssp_sensors/ssp_dev.c @@ -515,7 +515,7 @@ static int ssp_probe(struct spi_device * ret = spi_setup(spi); if (ret < 0) { dev_err(&spi->dev, "Failed to setup spi\n"); - return ret; + goto err_setup_spi; } data->fw_dl_state = SSP_FW_DL_STATE_NONE; @@ -580,6 +580,8 @@ err_read_reg: err_setup_irq: mutex_destroy(&data->pending_lock); mutex_destroy(&data->comm_lock); +err_setup_spi: + mfd_remove_devices(&spi->dev); dev_err(&spi->dev, "Probe failed!\n");