X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=block%2Fqed-check.c;h=e4a49ce72cb7ff92afeb9ed27220a1ede440fa7f;hb=9b02432b9f8ef3c093f6888a3e4c2c2d6631780a;hp=474c847d18203a3d3c2136c30d5987c2dca4532e;hpb=df8b863e2f7219eb3356ecc12635811241e38aad;p=sdk%2Femulator%2Fqemu.git diff --git a/block/qed-check.c b/block/qed-check.c index 474c847..e4a49ce 100644 --- a/block/qed-check.c +++ b/block/qed-check.c @@ -72,7 +72,8 @@ static unsigned int qed_check_l2_table(QEDCheck *check, QEDTable *table) for (i = 0; i < s->table_nelems; i++) { uint64_t offset = table->offsets[i]; - if (!offset) { + if (qed_offset_is_unalloc_cluster(offset) || + qed_offset_is_zero_cluster(offset)) { continue; } @@ -111,7 +112,7 @@ static int qed_check_l1_table(QEDCheck *check, QEDTable *table) unsigned int num_invalid_l2; uint64_t offset = table->offsets[i]; - if (!offset) { + if (qed_offset_is_unalloc_cluster(offset)) { continue; } @@ -196,7 +197,7 @@ int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix) }; int ret; - check.used_clusters = qemu_mallocz(((check.nclusters + 31) / 32) * + check.used_clusters = g_malloc0(((check.nclusters + 31) / 32) * sizeof(check.used_clusters[0])); ret = qed_check_l1_table(&check, s->l1_table); @@ -205,6 +206,6 @@ int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix) qed_check_for_leaks(&check); } - qemu_free(check.used_clusters); + g_free(check.used_clusters); return ret; }