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: <20191120123603.GE4495@amd>
Date:   Wed, 20 Nov 2019 13:36:03 +0100
From:   Pavel Machek <pavel@...x.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 353/422] slimbus: ngd: return proper error code
 instead of zero

On Tue 2019-11-19 06:19:10, Greg Kroah-Hartman wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> 
> [ Upstream commit 9652e6aa62a1836494ebb8dbd402587c083b568c ]
> 
> It looks like there is a typo in probe return. Fix it.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
>  drivers/slimbus/qcom-ngd-ctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
> index a9abde2f4088b..e587be9064e74 100644
> --- a/drivers/slimbus/qcom-ngd-ctrl.c
> +++ b/drivers/slimbus/qcom-ngd-ctrl.c
> @@ -1393,7 +1393,7 @@ wq_err:
>  	if (ctrl->mwq)
>  		destroy_workqueue(ctrl->mwq);
>  
> -	return 0;
> +	return ret;
>  }

The code makes no sense, even after the fix. Only way to enter wq_err
is with via if !ctrl->mwq... but it proceeds to test it for zero.

IOW... this.

Signed-off-by: Pavel Machek <pavel@...x.de>

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index d72f8eed2e8b..5a327d45dc2d 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1385,17 +1385,11 @@ static int qcom_slim_ngd_probe(struct platform_device *pdev)
 	ctrl->mwq = create_singlethread_workqueue("ngd_master");
 	if (!ctrl->mwq) {
 		dev_err(&pdev->dev, "Failed to start master worker\n");
-		ret = -ENOMEM;
-		goto wq_err;
+		qcom_slim_ngd_qmi_svc_event_deinit(&ctrl->qmi);
+		return -ENOMEM;
 	}
 
 	return 0;
-wq_err:
-	qcom_slim_ngd_qmi_svc_event_deinit(&ctrl->qmi);
-	if (ctrl->mwq)
-		destroy_workqueue(ctrl->mwq);
-
-	return ret;
 }
 
 static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev)


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ