Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361314
b: refs/heads/master
c: 6975404
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse authored and Guenter Roeck committed Mar 14, 2013
1 parent a89c663 commit cb49854
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df069079c153d22adf6c28dcc0b1cf62bba75167
refs/heads/master: 6975404fb9bcc3ca41946ce0506f97db30fb8705
12 changes: 7 additions & 5 deletions trunk/drivers/hwmon/pmbus/pmbus_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,12 +766,14 @@ static ssize_t pmbus_show_label(struct device *dev,
static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr)
{
if (data->num_attributes >= data->max_attributes - 1) {
data->max_attributes += PMBUS_ATTR_ALLOC_SIZE;
data->group.attrs = krealloc(data->group.attrs,
sizeof(struct attribute *) *
data->max_attributes, GFP_KERNEL);
if (data->group.attrs == NULL)
int new_max_attrs = data->max_attributes + PMBUS_ATTR_ALLOC_SIZE;
void *new_attrs = krealloc(data->group.attrs,
new_max_attrs * sizeof(void *),
GFP_KERNEL);
if (!new_attrs)
return -ENOMEM;
data->group.attrs = new_attrs;
data->max_attributes = new_max_attrs;
}

data->group.attrs[data->num_attributes++] = attr;
Expand Down

0 comments on commit cb49854

Please sign in to comment.