public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* regulator: core: Don't dereference config->dev before NULL checking for config
@ 2012-04-12  5:28 Axel Lin
  2012-04-12 14:48 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-04-12  5:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dan Carpenter, Liam Girdwood, Mark Brown

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 1bd71a8..bf46034 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2853,7 +2853,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
 	const struct regulator_init_data *init_data;
 	static atomic_t regulator_no = ATOMIC_INIT(0);
 	struct regulator_dev *rdev;
-	struct device *dev = config->dev;
+	struct device *dev;
 	int ret, i;
 	const char *supply = NULL;
 
@@ -2883,6 +2883,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
 		return ERR_PTR(-EINVAL);
 	}
 
+	dev = config->dev;
 	init_data = config->init_data;
 
 	rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL);
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: regulator: core: Don't dereference config->dev before NULL checking for config
  2012-04-12  5:28 regulator: core: Don't dereference config->dev before NULL checking for config Axel Lin
@ 2012-04-12 14:48 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-04-12 14:48 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Dan Carpenter, Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

On Thu, Apr 12, 2012 at 01:28:22PM +0800, Axel Lin wrote:
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Already fixed.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-12 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-12  5:28 regulator: core: Don't dereference config->dev before NULL checking for config Axel Lin
2012-04-12 14:48 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox