projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29d0b21
)
xen-blkback: fix foreach_grant_safe to handle empty lists
author
Roger Pau Monne
<
[email protected]
>
Mon, 18 Mar 2013 16:49:33 +0000
(17:49 +0100)
committer
Konrad Rzeszutek Wilk
<
[email protected]
>
Tue, 19 Mar 2013 12:53:15 +0000
(08:53 -0400)
We may use foreach_grant_safe in the future with empty lists, so make
sure we can handle them.
Signed-off-by: Roger Pau Monné <
[email protected]
>
Cc:
[email protected]
Cc: Konrad Rzeszutek Wilk <
[email protected]
>
Signed-off-by: Konrad Rzeszutek Wilk <
[email protected]
>
drivers/block/xen-blkback/blkback.c
patch
|
blob
|
history
diff --git
a/drivers/block/xen-blkback/blkback.c
b/drivers/block/xen-blkback/blkback.c
index 477a17c20820d74422f7549106a3e583df838a40..2cf8381a1c6e6fdc0c49344fcc111603611f2f94 100644
(file)
--- a/
drivers/block/xen-blkback/blkback.c
+++ b/
drivers/block/xen-blkback/blkback.c
@@
-164,7
+164,7
@@
static void make_response(struct xen_blkif *blkif, u64 id,
#define foreach_grant_safe(pos, n, rbtree, node) \
for ((pos) = container_of(rb_first((rbtree)), typeof(*(pos)), node), \
- (n) =
rb_next(&(pos)->node)
; \
+ (n) =
(&(pos)->node != NULL) ? rb_next(&(pos)->node) : NULL
; \
&(pos)->node != NULL; \
(pos) = container_of(n, typeof(*(pos)), node), \
(n) = (&(pos)->node != NULL) ? rb_next(&(pos)->node) : NULL)