aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/ubi.h
diff options
context:
space:
mode:
authorPhil Carmody <ext-phil.2.carmody@nokia.com>2009-07-23 09:29:10 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-08-14 13:01:36 -0400
commit758d8e46347aee199e7025b8c571bab75d2de63f (patch)
treec34a88972ec967785aa540156f776915c702ef4a /drivers/mtd/ubi/ubi.h
parent4a406856ea6830d8b8dba6a27d9f9331c5f4c13a (diff)
UBI: eliminate possible undefined behaviour
The assignment to pos when rb is finally NULL is undefined behaviour. Upon seeing that assignment, GCC may assume that rb is not NULL, and the loop condition ``rb'' may be optimised away. Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r--drivers/mtd/ubi/ubi.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 6a5fe9633783..c290f51dd178 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -579,7 +579,8 @@ void ubi_do_get_volume_info(struct ubi_device *ubi, struct ubi_volume *vol,
579 for (rb = rb_first(root), \ 579 for (rb = rb_first(root), \
580 pos = (rb ? container_of(rb, typeof(*pos), member) : NULL); \ 580 pos = (rb ? container_of(rb, typeof(*pos), member) : NULL); \
581 rb; \ 581 rb; \
582 rb = rb_next(rb), pos = container_of(rb, typeof(*pos), member)) 582 rb = rb_next(rb), \
583 pos = (rb ? container_of(rb, typeof(*pos), member) : NULL))
583 584
584/** 585/**
585 * ubi_zalloc_vid_hdr - allocate a volume identifier header object. 586 * ubi_zalloc_vid_hdr - allocate a volume identifier header object.