Re: [PATCH] block: genhd: fix double kfree() in __alloc_disk_node()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2021/09/20 15:40, Christoph Hellwig wrote:
> I was going to suggest to just move the bd_disk initialization after
> the bd_stats allocations,  but iseems like we currently don't even
> the zero the bdev on allocation.  So I suspect we should do that first
> to avoid nasty surprises.

Hmm? bdev_alloc_inode() zeros the bdev on allocation.
Are you talking about some other function?

static struct inode *bdev_alloc_inode(struct super_block *sb)
{
	struct bdev_inode *ei = kmem_cache_alloc(bdev_cachep, GFP_KERNEL);

	if (!ei)
		return NULL;
	memset(&ei->bdev, 0, sizeof(ei->bdev));
	return &ei->vfs_inode;
}



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux