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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri,  1 Mar 2019 13:24:47 +0100
From:   Johannes Berg <johannes@...solutions.net>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     "Rafael J. Wysocki" <rafael@...nel.org>,
        linux-kernel@...r.kernel.org,
        Johannes Berg <johannes.berg@...el.com>
Subject: [PATCH] driver core: platform: remove misleading err_alloc label

From: Johannes Berg <johannes.berg@...el.com>

In platform_device_register_full() the err_alloc label is
misleading, we only ever jump to it if the pdev is NULL,
but it then proceeds to free it, which is a no-op.

Remove the label and simply exit the function immediately.

Signed-off-by: Johannes Berg <johannes.berg@...el.com>
---
 drivers/base/platform.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 1c958eb33ef4..75fccb7dc908 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -508,7 +508,7 @@ struct platform_device *platform_device_register_full(
 
 	pdev = platform_device_alloc(pdevinfo->name, pdevinfo->id);
 	if (!pdev)
-		goto err_alloc;
+		return ERR_PTR(-ENOMEM);
 
 	pdev->dev.parent = pdevinfo->parent;
 	pdev->dev.fwnode = pdevinfo->fwnode;
@@ -553,8 +553,6 @@ struct platform_device *platform_device_register_full(
 err:
 		ACPI_COMPANION_SET(&pdev->dev, NULL);
 		kfree(pdev->dev.dma_mask);
-
-err_alloc:
 		platform_device_put(pdev);
 		return ERR_PTR(ret);
 	}
-- 
2.17.2

Powered by blists - more mailing lists