5d6d270110
- Fix blkid -g segfault when clearing entries (#452333)
22 lines
569 B
Diff
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;
|
|
|