e2fsprogs/e2fsprogs-1.40-list_for_each_safe.patch
Eric Sandeen 5d6d270110 * Fri Jun 20 2008 Eric Sandeen <sandeen@redhat.com> 1.41-0.WIP.0617.1
- Fix blkid -g segfault when clearing entries (#452333)
2008-06-21 03:37:05 +00:00

22 lines
569 B
Diff

Index: e2fsprogs-1.41/lib/blkid/cache.c
===================================================================
--- e2fsprogs-1.41.orig/lib/blkid/cache.c
+++ e2fsprogs-1.41/lib/blkid/cache.c
@@ -154,13 +154,13 @@ void blkid_put_cache(blkid_cache cache)
void blkid_gc_cache(blkid_cache cache)
{
- struct list_head *p;
+ struct list_head *p, *n;
struct stat st;
if (!cache)
return;
- list_for_each(p, &cache->bic_devs) {
+ list_for_each_safe(p, n, &cache->bic_devs) {
blkid_dev dev = list_entry(p, struct blkid_struct_dev, bid_devs);
if (!p)
break;