diff options
author | Hannes Reinecke <hare@suse.de> | 2012-04-16 09:06:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-18 18:39:52 -0400 |
commit | a15d49fd3094cff90e5410ca454a870e0a722fe1 (patch) | |
tree | f3e458fa4ce3524f756e0faa48d5ed2400c022bf /include | |
parent | 97ec448aeadff55234368a89c4a07a7ef290a084 (diff) |
driver core: check start node in klist_iter_init_node
klist_iter_init_node() takes a node as a start argument.
However, this node might not be valid anymore.
This patch updates the klist_iter_init_node() and
dependent functions to return an error if so.
All calling functions have been audited to check
for a return code here.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: Greg Kroah-Hartmann <gregkh@linuxfoundation.org>
Cc: Kay Sievers <kay@vrfy.org>
Cc: Stable Kernel <stable@kernel.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/device.h | 10 | ||||
-rw-r--r-- | include/linux/klist.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 5ad17cccdd71..50429b911b21 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -128,7 +128,7 @@ struct subsys_dev_iter { | |||
128 | struct klist_iter ki; | 128 | struct klist_iter ki; |
129 | const struct device_type *type; | 129 | const struct device_type *type; |
130 | }; | 130 | }; |
131 | void subsys_dev_iter_init(struct subsys_dev_iter *iter, | 131 | int subsys_dev_iter_init(struct subsys_dev_iter *iter, |
132 | struct bus_type *subsys, | 132 | struct bus_type *subsys, |
133 | struct device *start, | 133 | struct device *start, |
134 | const struct device_type *type); | 134 | const struct device_type *type); |
@@ -380,10 +380,10 @@ int class_compat_create_link(struct class_compat *cls, struct device *dev, | |||
380 | void class_compat_remove_link(struct class_compat *cls, struct device *dev, | 380 | void class_compat_remove_link(struct class_compat *cls, struct device *dev, |
381 | struct device *device_link); | 381 | struct device *device_link); |
382 | 382 | ||
383 | extern void class_dev_iter_init(struct class_dev_iter *iter, | 383 | extern int class_dev_iter_init(struct class_dev_iter *iter, |
384 | struct class *class, | 384 | struct class *class, |
385 | struct device *start, | 385 | struct device *start, |
386 | const struct device_type *type); | 386 | const struct device_type *type); |
387 | extern struct device *class_dev_iter_next(struct class_dev_iter *iter); | 387 | extern struct device *class_dev_iter_next(struct class_dev_iter *iter); |
388 | extern void class_dev_iter_exit(struct class_dev_iter *iter); | 388 | extern void class_dev_iter_exit(struct class_dev_iter *iter); |
389 | 389 | ||
diff --git a/include/linux/klist.h b/include/linux/klist.h index a370ce57cf1d..9f633230f189 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h | |||
@@ -60,7 +60,7 @@ struct klist_iter { | |||
60 | 60 | ||
61 | 61 | ||
62 | extern void klist_iter_init(struct klist *k, struct klist_iter *i); | 62 | extern void klist_iter_init(struct klist *k, struct klist_iter *i); |
63 | extern void klist_iter_init_node(struct klist *k, struct klist_iter *i, | 63 | extern int klist_iter_init_node(struct klist *k, struct klist_iter *i, |
64 | struct klist_node *n); | 64 | struct klist_node *n); |
65 | extern void klist_iter_exit(struct klist_iter *i); | 65 | extern void klist_iter_exit(struct klist_iter *i); |
66 | extern struct klist_node *klist_next(struct klist_iter *i); | 66 | extern struct klist_node *klist_next(struct klist_iter *i); |