All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org
Subject: [hch-block:bdev-inode 71/72] block/partitions/core.c:417 add_partition() warn: passing zero to 'ERR_PTR'
Date: Mon, 16 Nov 2020 12:29:10 +0300	[thread overview]
Message-ID: <20201116092910.GV29398@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 12153 bytes --]

tree:   git://git.infradead.org/users/hch/block.git bdev-inode
head:   aa9426788d1aeb32c20dfd1e0181a42a8dd0890d
commit: 884bbcdbaaf8439db16bcf64ec891dcc62d172ea [71/72] block: merge struct block_device and struct hd_struct
config: x86_64-randconfig-m001-20201115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
block/partitions/core.c:417 add_partition() warn: passing zero to 'ERR_PTR'

vim +/ERR_PTR +417 block/partitions/core.c

884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  313  static struct block_device *add_partition(struct gendisk *disk, int partno,
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  314  				sector_t start, sector_t len, int flags,
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  315  				struct partition_meta_info *info)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  316  {
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  317  	struct block_device *p;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  318  	dev_t devt = MKDEV(0, 0);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  319  	struct device *ddev = disk_to_dev(disk);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  320  	struct device *pdev;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  321  	struct disk_part_tbl *ptbl;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  322  	const char *dname;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  323  	int err;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  324  
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  325  	/*
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  326  	 * Partitions are not supported on zoned block devices that are used as
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  327  	 * such.
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  328  	 */
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  329  	switch (disk->queue->limits.zoned) {
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  330  	case BLK_ZONED_HM:
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  331  		pr_warn("%s: partitions not supported on host managed zoned block device\n",
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  332  			disk->disk_name);
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  333  		return ERR_PTR(-ENXIO);
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  334  	case BLK_ZONED_HA:
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  335  		pr_info("%s: disabling host aware zoned block device support due to partitions\n",
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  336  			disk->disk_name);
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  337  		disk->queue->limits.zoned = BLK_ZONED_NONE;
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  338  		break;
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  339  	case BLK_ZONED_NONE:
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  340  		break;
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  341  	}
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  342  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  343  	err = disk_expand_part_tbl(disk, partno);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  344  	if (err)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  345  		return ERR_PTR(err);
6d2cf6f2b446c4 block/partition-generic.c Bart Van Assche   2017-08-17  346  	ptbl = rcu_dereference_protected(disk->part_tbl, 1);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  347  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  348  	if (ptbl->part[partno])
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  349  		return ERR_PTR(-EBUSY);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  350  
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  351  	p = bdev_alloc(disk, partno);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  352  	if (!p)
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  353  		return ERR_PTR(-ENOMEM);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  354  
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  355  	p->bd_start_sect = start;
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  356  	bdev_set_nr_sectors(p, len);
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  357  	p->bd_policy = get_disk_ro(disk);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  358  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  359  	if (info) {
f17c21c1ecb80e block/partition-generic.c Christoph Hellwig 2020-03-24  360  		struct partition_meta_info *pinfo;
f17c21c1ecb80e block/partition-generic.c Christoph Hellwig 2020-03-24  361  
f17c21c1ecb80e block/partition-generic.c Christoph Hellwig 2020-03-24  362  		pinfo = kzalloc_node(sizeof(*pinfo), GFP_KERNEL, disk->node_id);
010459fd9ad527 block/partitions/core.c   Christoph Hellwig 2020-08-31  363  		if (!pinfo)
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  364  			goto out_free_stats;

missing "err = -ENOMEM;"

94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  365  		memcpy(pinfo, info, sizeof(*info));
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  366  		p->bd_meta_info = pinfo;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  367  	}
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  368  
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  369  	pdev = part_to_dev(p);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  370  	dname = dev_name(ddev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  371  	if (isdigit(dname[strlen(dname) - 1]))
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  372  		dev_set_name(pdev, "%sp%d", dname, partno);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  373  	else
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  374  		dev_set_name(pdev, "%s%d", dname, partno);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  375  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  376  	device_initialize(pdev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  377  	pdev->class = &block_class;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  378  	pdev->type = &part_type;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  379  	pdev->parent = ddev;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  380  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  381  	err = blk_alloc_devt(p, &devt);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  382  	if (err)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  383  		goto out_free_info;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  384  	pdev->devt = devt;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  385  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  386  	/* delay uevent until 'holders' subdir is created */
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  387  	dev_set_uevent_suppress(pdev, 1);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  388  	err = device_add(pdev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  389  	if (err)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  390  		goto out_put;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  391  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  392  	err = -ENOMEM;
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  393  	p->bd_holder_dir = kobject_create_and_add("holders", &pdev->kobj);
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  394  	if (!p->bd_holder_dir)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  395  		goto out_del;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  396  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  397  	dev_set_uevent_suppress(pdev, 0);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  398  	if (flags & ADDPART_FLAG_WHOLEDISK) {
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  399  		err = device_create_file(pdev, &dev_attr_whole_disk);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  400  		if (err)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  401  			goto out_del;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  402  	}
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  403  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  404  	/* everything is up and running, commence */
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  405  	bdev_add(p, devt);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  406  	rcu_assign_pointer(ptbl->part[partno], p);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  407  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  408  	/* suppress uevent if the disk suppresses it */
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  409  	if (!dev_get_uevent_suppress(ddev))
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  410  		kobject_uevent(&pdev->kobj, KOBJ_ADD);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  411  	return p;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  412  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  413  out_free_info:
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  414  	kfree(p->bd_meta_info);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  415  out_free_stats:
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  416  	bdput(p);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16 @417  	return ERR_PTR(err);
010459fd9ad527 block/partitions/core.c   Christoph Hellwig 2020-08-31  418  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  419  out_del:
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  420  	kobject_put(p->bd_holder_dir);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  421  	device_del(pdev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  422  out_put:
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  423  	put_device(pdev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  424  	return ERR_PTR(err);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  425  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31307 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild-all@lists.01.org
Subject: [hch-block:bdev-inode 71/72] block/partitions/core.c:417 add_partition() warn: passing zero to 'ERR_PTR'
Date: Mon, 16 Nov 2020 12:29:10 +0300	[thread overview]
Message-ID: <20201116092910.GV29398@kadam> (raw)

[-- Attachment #1: Type: text/plain, Size: 12153 bytes --]

tree:   git://git.infradead.org/users/hch/block.git bdev-inode
head:   aa9426788d1aeb32c20dfd1e0181a42a8dd0890d
commit: 884bbcdbaaf8439db16bcf64ec891dcc62d172ea [71/72] block: merge struct block_device and struct hd_struct
config: x86_64-randconfig-m001-20201115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
block/partitions/core.c:417 add_partition() warn: passing zero to 'ERR_PTR'

vim +/ERR_PTR +417 block/partitions/core.c

884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  313  static struct block_device *add_partition(struct gendisk *disk, int partno,
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  314  				sector_t start, sector_t len, int flags,
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  315  				struct partition_meta_info *info)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  316  {
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  317  	struct block_device *p;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  318  	dev_t devt = MKDEV(0, 0);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  319  	struct device *ddev = disk_to_dev(disk);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  320  	struct device *pdev;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  321  	struct disk_part_tbl *ptbl;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  322  	const char *dname;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  323  	int err;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  324  
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  325  	/*
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  326  	 * Partitions are not supported on zoned block devices that are used as
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  327  	 * such.
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  328  	 */
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  329  	switch (disk->queue->limits.zoned) {
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  330  	case BLK_ZONED_HM:
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  331  		pr_warn("%s: partitions not supported on host managed zoned block device\n",
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  332  			disk->disk_name);
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  333  		return ERR_PTR(-ENXIO);
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  334  	case BLK_ZONED_HA:
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  335  		pr_info("%s: disabling host aware zoned block device support due to partitions\n",
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  336  			disk->disk_name);
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  337  		disk->queue->limits.zoned = BLK_ZONED_NONE;
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  338  		break;
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  339  	case BLK_ZONED_NONE:
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  340  		break;
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  341  	}
b72053072c0bbe block/partition-generic.c Christoph Hellwig 2020-01-26  342  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  343  	err = disk_expand_part_tbl(disk, partno);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  344  	if (err)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  345  		return ERR_PTR(err);
6d2cf6f2b446c4 block/partition-generic.c Bart Van Assche   2017-08-17  346  	ptbl = rcu_dereference_protected(disk->part_tbl, 1);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  347  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  348  	if (ptbl->part[partno])
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  349  		return ERR_PTR(-EBUSY);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  350  
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  351  	p = bdev_alloc(disk, partno);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  352  	if (!p)
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  353  		return ERR_PTR(-ENOMEM);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  354  
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  355  	p->bd_start_sect = start;
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  356  	bdev_set_nr_sectors(p, len);
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  357  	p->bd_policy = get_disk_ro(disk);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  358  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  359  	if (info) {
f17c21c1ecb80e block/partition-generic.c Christoph Hellwig 2020-03-24  360  		struct partition_meta_info *pinfo;
f17c21c1ecb80e block/partition-generic.c Christoph Hellwig 2020-03-24  361  
f17c21c1ecb80e block/partition-generic.c Christoph Hellwig 2020-03-24  362  		pinfo = kzalloc_node(sizeof(*pinfo), GFP_KERNEL, disk->node_id);
010459fd9ad527 block/partitions/core.c   Christoph Hellwig 2020-08-31  363  		if (!pinfo)
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  364  			goto out_free_stats;

missing "err = -ENOMEM;"

94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  365  		memcpy(pinfo, info, sizeof(*info));
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  366  		p->bd_meta_info = pinfo;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  367  	}
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  368  
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  369  	pdev = part_to_dev(p);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  370  	dname = dev_name(ddev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  371  	if (isdigit(dname[strlen(dname) - 1]))
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  372  		dev_set_name(pdev, "%sp%d", dname, partno);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  373  	else
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  374  		dev_set_name(pdev, "%s%d", dname, partno);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  375  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  376  	device_initialize(pdev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  377  	pdev->class = &block_class;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  378  	pdev->type = &part_type;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  379  	pdev->parent = ddev;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  380  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  381  	err = blk_alloc_devt(p, &devt);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  382  	if (err)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  383  		goto out_free_info;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  384  	pdev->devt = devt;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  385  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  386  	/* delay uevent until 'holders' subdir is created */
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  387  	dev_set_uevent_suppress(pdev, 1);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  388  	err = device_add(pdev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  389  	if (err)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  390  		goto out_put;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  391  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  392  	err = -ENOMEM;
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  393  	p->bd_holder_dir = kobject_create_and_add("holders", &pdev->kobj);
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  394  	if (!p->bd_holder_dir)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  395  		goto out_del;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  396  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  397  	dev_set_uevent_suppress(pdev, 0);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  398  	if (flags & ADDPART_FLAG_WHOLEDISK) {
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  399  		err = device_create_file(pdev, &dev_attr_whole_disk);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  400  		if (err)
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  401  			goto out_del;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  402  	}
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  403  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  404  	/* everything is up and running, commence */
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  405  	bdev_add(p, devt);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  406  	rcu_assign_pointer(ptbl->part[partno], p);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  407  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  408  	/* suppress uevent if the disk suppresses it */
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  409  	if (!dev_get_uevent_suppress(ddev))
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  410  		kobject_uevent(&pdev->kobj, KOBJ_ADD);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  411  	return p;
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  412  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  413  out_free_info:
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  414  	kfree(p->bd_meta_info);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  415  out_free_stats:
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  416  	bdput(p);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16 @417  	return ERR_PTR(err);
010459fd9ad527 block/partitions/core.c   Christoph Hellwig 2020-08-31  418  
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  419  out_del:
884bbcdbaaf843 block/partitions/core.c   Christoph Hellwig 2020-11-14  420  	kobject_put(p->bd_holder_dir);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  421  	device_del(pdev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  422  out_put:
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  423  	put_device(pdev);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  424  	return ERR_PTR(err);
94ea4158f1733e block/partition-generic.c Al Viro           2011-09-16  425  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31307 bytes --]

             reply	other threads:[~2020-11-16  9:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16  9:29 Dan Carpenter [this message]
2020-11-16  9:29 ` [hch-block:bdev-inode 71/72] block/partitions/core.c:417 add_partition() warn: passing zero to 'ERR_PTR' Dan Carpenter
2020-11-16 10:00 ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2020-11-15  0:23 kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201116092910.GV29398@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.