Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21956
b: refs/heads/master
c: 048975a
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Mar 20, 2006
1 parent 47ef627 commit 0ce0dfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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: 0b3ea0829cbcdaee6e018a83a2949ef458213f3b
refs/heads/master: 048975ac580a771fc5bb96c6b454cba897ab1a73
6 changes: 4 additions & 2 deletions trunk/drivers/infiniband/core/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static ssize_t state_show(struct ib_port *p, struct port_attribute *unused,
return ret;

return sprintf(buf, "%d: %s\n", attr.state,
attr.state >= 0 && attr.state <= ARRAY_SIZE(state_name) ?
attr.state >= 0 && attr.state < ARRAY_SIZE(state_name) ?
state_name[attr.state] : "UNKNOWN");
}

Expand Down Expand Up @@ -472,8 +472,10 @@ alloc_group_attrs(ssize_t (*show)(struct ib_port *,
goto err;

if (snprintf(element->name, sizeof(element->name),
"%d", i) >= sizeof(element->name))
"%d", i) >= sizeof(element->name)) {
kfree(element);
goto err;
}

element->attr.attr.name = element->name;
element->attr.attr.mode = S_IRUGO;
Expand Down

0 comments on commit 0ce0dfe

Please sign in to comment.