Skip to content

Commit a226950

Browse files
committed
[drivers][regulator] initialize record pointer to RT_NULL in find_record functions
1 parent 79b364f commit a226950

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

components/drivers/regulator/regulator.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static rt_err_t regulator_disable(struct rt_regulator_node *reg_np);
3838

3939
static struct rt_regulator_record *regulator_find_record_by_name(const char *name)
4040
{
41-
struct rt_regulator_record *record;
41+
struct rt_regulator_record *record = RT_NULL;
4242

4343
rt_list_for_each_entry(record, &_regulator_records, list)
4444
{
@@ -53,7 +53,7 @@ static struct rt_regulator_record *regulator_find_record_by_name(const char *nam
5353

5454
static struct rt_regulator_record *regulator_find_record_by_node(struct rt_regulator_node *reg_np)
5555
{
56-
struct rt_regulator_record *record;
56+
struct rt_regulator_record *record = RT_NULL;
5757

5858
rt_list_for_each_entry(record, &_regulator_records, list)
5959
{

0 commit comments

Comments
 (0)