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] [thread-next>] [day] [month] [year] [list]
Message-ID: <YLBnIDrNVVePv3gZ@builder.lan>
Date:   Thu, 27 May 2021 22:44:32 -0500
From:   Bjorn Andersson <bjorn.andersson@...aro.org>
To:     Siddharth Gupta <sidgup@...eaurora.org>
Cc:     ohad@...ery.com, linux-remoteproc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, psodagud@...eaurora.org,
        stable@...r.kernel.org
Subject: Re: [PATCH 2/3] remoteproc: core: Move validate before device add

On Mon 17 May 15:45 CDT 2021, Siddharth Gupta wrote:

> We can validate whether the remoteproc is correctly setup before
> calling making the cdev_add and device_add calls. This saves us
> the trouble of cleaning up later on.
> 

Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>

> Signed-off-by: Siddharth Gupta <sidgup@...eaurora.org>
> ---
>  drivers/remoteproc/remoteproc_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 562355a..45d09bf 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -2316,16 +2316,16 @@ int rproc_add(struct rproc *rproc)
>  	struct device *dev = &rproc->dev;
>  	int ret;
>  
> -	/* add char device for this remoteproc */
> -	ret = rproc_char_device_add(rproc);
> +	ret = rproc_validate(rproc);
>  	if (ret < 0)
>  		return ret;
>  
> -	ret = device_add(dev);
> +	/* add char device for this remoteproc */
> +	ret = rproc_char_device_add(rproc);
>  	if (ret < 0)
>  		return ret;
>  
> -	ret = rproc_validate(rproc);
> +	ret = device_add(dev);
>  	if (ret < 0)
>  		return ret;
>  
> -- 
> Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ