OSDN Git Service

Remove excessive check in free_cluster().
authorrelan <relan@users.noreply.github.com>
Fri, 17 Mar 2017 06:41:47 +0000 (09:41 +0300)
committerrelan <relan@users.noreply.github.com>
Sun, 19 Mar 2017 16:10:38 +0000 (19:10 +0300)
Cluster validity has already been checked.

libexfat/cluster.c

index 19b7d0d..5a26133 100644 (file)
@@ -214,10 +214,8 @@ static cluster_t allocate_cluster(struct exfat* ef, cluster_t hint)
 
 static void free_cluster(struct exfat* ef, cluster_t cluster)
 {
-       if (CLUSTER_INVALID(*ef->sb, cluster))
-               exfat_bug("freeing invalid cluster 0x%x", cluster);
        if (cluster - EXFAT_FIRST_DATA_CLUSTER >= ef->cmap.size)
-               exfat_bug("freeing non-existing cluster 0x%x (0x%x)", cluster,
+               exfat_bug("caller must check cluster validity (%#x, %#x)", cluster,
                                ef->cmap.size);
 
        BMAP_CLR(ef->cmap.chunk, cluster - EXFAT_FIRST_DATA_CLUSTER);