]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libblkid: remove unneeded pointer checks
authorTheodore Ts'o <tytso@mit.edu>
Sat, 11 Jan 2014 02:53:08 +0000 (21:53 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 11 Jan 2014 02:53:08 +0000 (21:53 -0500)
Addresses-Coverity-Id: #207522
Addresses-Coverity-Id: #207523

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/blkid/cache.c
lib/blkid/devname.c

index 8bdd239916c2a6884c0d48b29161d0cdeed495fe..2a2df13cd378241fd2a92782c304363689078e73 100644 (file)
@@ -167,8 +167,6 @@ void blkid_gc_cache(blkid_cache cache)
 
        list_for_each_safe(p, pnext, &cache->bic_devs) {
                blkid_dev dev = list_entry(p, struct blkid_struct_dev, bid_devs);
-               if (!p)
-                       break;
                if (stat(dev->bid_name, &st) < 0) {
                        DBG(DEBUG_CACHE,
                            printf("freeing %s\n", dev->bid_name));
index a6673c17c50f81d03b01280e48086f0cf5b7e8db..3e2efa9d5cb20fc776583dbbb2211273fc363c9a 100644 (file)
@@ -91,8 +91,6 @@ blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, int flags)
                 */
                list_for_each_safe(p, pnext, &cache->bic_devs) {
                        blkid_dev dev2;
-                       if (!p)
-                               break;
                        dev2 = list_entry(p, struct blkid_struct_dev, bid_devs);
                        if (dev2->bid_flags & BLKID_BID_FL_VERIFIED)
                                continue;