/* Description: returns GPT header on success, NULL on error. Allocates and fills a GPT header starting at @ from @bdev. Note: remember to free gpt when finished with it.  */
static gpt_header* alloc_read_gpt_header(struct block_device *bdev, u64 lba)
/* Description: returns GPT header on success, NULL on error. Allocates and fills a GPT header starting at @ from @bdev. Note: remember to free gpt when finished with it.  */
static gpt_header* alloc_read_gpt_header(struct block_device *bdev, u64 lba)
{
	gpt_header *gpt;
	unsigned ssz = bdev_logical_block_size(bdev);
	if (!bdev)
		return NULL;
	gpt = kzalloc(ssz, GFP_KERNEL);
	if (!gpt)
		return NULL;
	if (read_lba(bdev, lba, (u8 *) gpt, ssz) < ssz) {
		kfree(gpt);
                gpt=NULL;
		return NULL;
	}
	return gpt;
}