lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e4c94731-aff5-4361-ae27-3e5271700dcd@ti.com>
Date: Fri, 6 Sep 2024 17:10:50 -0500
From: Andrew Davis <afd@...com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
        Bjorn Andersson
	<andersson@...nel.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Beleswar Padhi <b-padhi@...com>
CC: <linux-kernel@...r.kernel.org>, <kernel-janitors@...r.kernel.org>,
        <linux-remoteproc@...r.kernel.org>
Subject: Re: [PATCH] remoteproc: k3-dsp: Fix an error handling path in
 max77686_rtc_probe()

On 9/6/24 3:12 PM, Christophe JAILLET wrote:
> If an error occurs after the k3_dsp_rproc_request_mbox() call,
> mbox_free_channel() must be called, as already done in the remove function.
> 
> Instead of adding an error handling path in the probe and changing all
> error handling in the function, add a new devm_add_action_or_reset() and
> simplify the .remove() function.
> 

Your patch subject is messed up, otherwise LGTM.

Reviewed-by: Andrew Davis <afd@...com>

> Fixes: ea1d6fb5b571 ("remoteproc: k3-dsp: Acquire mailbox handle during probe routine")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> Compile tested only
> ---
>   drivers/remoteproc/ti_k3_dsp_remoteproc.c | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> index 8be3f631c192..f29780de37a5 100644
> --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
> @@ -610,6 +610,13 @@ static void k3_dsp_release_tsp(void *data)
>   	ti_sci_proc_release(tsp);
>   }
>   
> +static void k3_dsp_free_channel(void *data)
> +{
> +	struct k3_dsp_rproc *kproc = data;
> +
> +	mbox_free_channel(kproc->mbox);
> +}
> +
>   static int k3_dsp_rproc_probe(struct platform_device *pdev)
>   {
>   	struct device *dev = &pdev->dev;
> @@ -649,6 +656,10 @@ static int k3_dsp_rproc_probe(struct platform_device *pdev)
>   	if (ret)
>   		return ret;
>   
> +	ret = devm_add_action_or_reset(dev, k3_dsp_free_channel, rproc);
> +	if (ret)
> +		return ret;
> +
>   	kproc->ti_sci = devm_ti_sci_get_by_phandle(dev, "ti,sci");
>   	if (IS_ERR(kproc->ti_sci))
>   		return dev_err_probe(dev, PTR_ERR(kproc->ti_sci),
> @@ -741,8 +752,6 @@ static void k3_dsp_rproc_remove(struct platform_device *pdev)
>   		if (ret)
>   			dev_err(dev, "failed to detach proc (%pe)\n", ERR_PTR(ret));
>   	}
> -
> -	mbox_free_channel(kproc->mbox);
>   }
>   
>   static const struct k3_dsp_mem_data c66_mems[] = {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ