[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <55b8ad8c5e7ad38403c34a5d30d49f8aaba37156.1519883835.git.arvind.yadav.cs@gmail.com>
Date: Thu, 1 Mar 2018 11:29:29 +0530
From: Arvind Yadav <arvind.yadav.cs@...il.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] driver core: Free memory obtained by kzalloc
Here kfree() is taking NULL. So moving 'dev = NULL' after kfree().
Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
drivers/base/bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index ef61833..ccb64a0 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -1170,9 +1170,9 @@ static int subsys_register(struct bus_type *subsys,
err_dev_reg:
put_device(dev);
- dev = NULL;
err_name:
kfree(dev);
+ dev = NULL;
err_dev:
bus_unregister(subsys);
return err;
--
1.9.1
Powered by blists - more mailing lists