Skip to content

Commit

Permalink
occ: sensors: Fix the size of the phandle array 'sensors' in DT
Browse files Browse the repository at this point in the history
Fixes: 99505c0 ("sensor-groups: occ: Add support to disable/enable sensor group")
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
shilpasri authored and stewartsmith committed Jul 4, 2018
1 parent e21159b commit d6de8fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/occ.c
Original file line number Diff line number Diff line change
Expand Up @@ -1688,11 +1688,11 @@ void occ_add_sensor_groups(struct dt_node *sg, u32 *phandles, u32 *ptype,
_phandles[pcount++] = phandles[k];
if (pcount)
dt_add_property(node, "sensors", _phandles,
pcount);
pcount * sizeof(u32));
free(_phandles);
} else {
dt_add_property(node, "sensors", phandles,
nr_phandles);
nr_phandles * sizeof(u32));
}
dt_add_property_cells(node, "ops", groups[j].ops);
}
Expand Down

0 comments on commit d6de8fe

Please sign in to comment.