From 688a6fb6a4bc49c2e18b2ce8fadc1e0d1bd20ad3 Mon Sep 17 00:00:00 2001 From: relan Date: Fri, 17 Mar 2017 09:41:47 +0300 Subject: [PATCH] Remove excessive check in free_cluster(). Cluster validity has already been checked. --- libexfat/cluster.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libexfat/cluster.c b/libexfat/cluster.c index 19b7d0d..5a26133 100644 --- a/libexfat/cluster.c +++ b/libexfat/cluster.c @@ -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); -- 2.11.0