[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20180309140959.30237-1-srinivas.kandagatla@linaro.org>
Date: Fri, 9 Mar 2018 14:09:59 +0000
From: srinivas.kandagatla@...aro.org
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org, srinivas.kandagatla@...aro.org,
Arvind Yadav <arvind.yadav.cs@...il.com>
Subject: [PATCH] slimbus: core: use put_device() instead of kfree()
From: Arvind Yadav <arvind.yadav.cs@...il.com>
Never directly free @dev after calling device_register(), even
if it returned an error! Always use put_device() to give up the
reference initialized.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
Hi Greg,
Can you pick this single slimbus patch for 4.17 merge cycle.
Thanks,
srini
drivers/slimbus/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
index 4988a8f4d905..7ddfc675b131 100644
--- a/drivers/slimbus/core.c
+++ b/drivers/slimbus/core.c
@@ -141,7 +141,7 @@ static struct slim_device *slim_alloc_device(struct slim_controller *ctrl,
sbdev->e_addr = *eaddr;
ret = slim_add_device(ctrl, sbdev, node);
if (ret) {
- kfree(sbdev);
+ put_device(&sbdev->dev);
return NULL;
}
--
2.15.1
Powered by blists - more mailing lists