diff options
author | Julia Lawall <julia@diku.dk> | 2010-08-07 11:09:29 +0200 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-08-30 09:19:11 +0200 |
commit | 01ebc12f5f2e88a1c6a5436b71a506ac2bf66d6b (patch) | |
tree | 7c3e748518efe1f42c82eb922d1d6625964282a2 /drivers/mtd/ubi/scan.c | |
parent | Linux 2.6.36-rc3 (diff) | |
download | linux-01ebc12f5f2e88a1c6a5436b71a506ac2bf66d6b.tar.xz linux-01ebc12f5f2e88a1c6a5436b71a506ac2bf66d6b.zip |
UBI: eliminate update of list_for_each_entry loop cursor
list_for_each_entry uses its first argument to move from one element to the
next, so modifying it can break the iteration. The variable re1 is already
used within the loop as a temporary variable, and is not live here.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r@
iterator name list_for_each_entry;
expression x,E;
position p1,p2;
@@
list_for_each_entry@p1(x,...) { <... x =@p2 E ...> }
@@
expression x,E;
position r.p1,r.p2;
statement S;
@@
*x =@p2 E
...
list_for_each_entry@p1(x,...) S
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
0 files changed, 0 insertions, 0 deletions