UBI: eliminate possible undefined behaviour
authorPhil Carmody <ext-phil.2.carmody@nokia.com>
Thu, 23 Jul 2009 13:29:10 +0000 (15:29 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 14 Aug 2009 17:01:36 +0000 (20:01 +0300)
commit758d8e46347aee199e7025b8c571bab75d2de63f
treec34a88972ec967785aa540156f776915c702ef4a
parent4a406856ea6830d8b8dba6a27d9f9331c5f4c13a
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>
drivers/mtd/ubi/ubi.h