Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108988
b: refs/heads/master
c: 7c22503
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Greg Kroah-Hartman committed Aug 21, 2008
1 parent 09c532d commit e9a6d3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf9ca69fc8d19d4034391d3df4c35dccdef9d28c
refs/heads/master: 7c2250352e11bf956c4cfa20b01ae6ba72882788
11 changes: 11 additions & 0 deletions trunk/drivers/base/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ int class_for_each_device(struct class *class, struct device *start,

if (!class)
return -EINVAL;
if (!class->p) {
WARN(1, "%s called for class '%s' before it was initialized",
__func__, class->name);
return -EINVAL;
}

mutex_lock(&class->p->class_mutex);
list_for_each_entry(dev, &class->p->class_devices, node) {
if (start) {
Expand Down Expand Up @@ -344,6 +350,11 @@ struct device *class_find_device(struct class *class, struct device *start,

if (!class)
return NULL;
if (!class->p) {
WARN(1, "%s called for class '%s' before it was initialized",
__func__, class->name);
return NULL;
}

mutex_lock(&class->p->class_mutex);
list_for_each_entry(dev, &class->p->class_devices, node) {
Expand Down

0 comments on commit e9a6d3f

Please sign in to comment.