Whamcloud - gitweb
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 8bdd239..2a2df13 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 a6673c1..3e2efa9 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;