Re: [PATCH v2 29/34] bdev: make struct bdev_handle private to the block layer

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

 



On Tue 23-01-24 14:26:46, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>

One more thing I've noticed:

> -struct bdev_handle *bdev_open_by_dev(dev_t dev, blk_mode_t mode, void *holder,
> -				     const struct blk_holder_ops *hops)
> +int bdev_open(struct block_device *bdev, blk_mode_t mode, void *holder,
> +	      const struct blk_holder_ops *hops, struct file *bdev_file)
>  {
>  	struct bdev_handle *handle = kmalloc(sizeof(struct bdev_handle),
>  					     GFP_KERNEL);
> -	struct block_device *bdev;
>  	bool unblock_events = true;
> -	struct gendisk *disk;
> +	struct gendisk *disk = bdev->bd_disk;
>  	int ret;
>  
> +	handle = kmalloc(sizeof(struct bdev_handle), GFP_KERNEL);

You are leaking handle here. It gets fixed up later in the series but
still...

								Honza
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux