[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1322309959.6001.1.camel@phoenix>
Date: Sat, 26 Nov 2011 20:19:19 +0800
From: Axel Lin <axel.lin@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Rajendra Nayak <rnayak@...com>, Liam Girdwood <lrg@...com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: [PATCH] regulator: Checking return value of
of_get_regulator_init_data
of_get_regulator_init_data() may return NULL, thus
check the return value to avoid NULL pointer dereference.
Signed-off-by: Axel Lin <axel.lin@...il.com>
---
drivers/regulator/fixed.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 716ea37..639e19d 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -64,6 +64,9 @@ struct fixed_voltage_config *of_get_fixed_voltage_config(struct device *dev)
return NULL;
config->init_data = of_get_regulator_init_data(dev);
+ if (!config->init_data)
+ return NULL;
+
init_data = config->init_data;
config->supply_name = init_data->constraints.name;
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists