lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d6140e40-a472-e732-9893-99e1839b717e@linux.ibm.com>
Date:   Mon, 13 Sep 2021 10:17:48 +0200
From:   Jan Höppner <hoeppner@...ux.ibm.com>
To:     Luis Chamberlain <mcgrof@...nel.org>, axboe@...nel.dk,
        gregkh@...uxfoundation.org, chaitanya.kulkarni@....com,
        atulgopinathan@...il.com, hare@...e.de, maximlevitsky@...il.com,
        oakad@...oo.com, ulf.hansson@...aro.org, colin.king@...onical.com,
        shubhankarvk@...il.com, baijiaju1990@...il.com, trix@...hat.com,
        dongsheng.yang@...ystack.cn, ceph-devel@...r.kernel.org,
        miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
        sth@...ux.ibm.com, hca@...ux.ibm.com, gor@...ux.ibm.com,
        borntraeger@...ibm.com, oberpar@...ux.ibm.com, tj@...nel.org
Cc:     linux-s390@...r.kernel.org, linux-mtd@...ts.infradead.org,
        linux-mmc@...r.kernel.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/9] s390/block/dasd_genhd: add error handling support for
 add_disk()

On 02/09/2021 19:41, Luis Chamberlain wrote:
> We never checked for errors on add_disk() as this function
> returned void. Now that this is fixed, use the shiny new
> error handling.
> 
> Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
> ---
>  drivers/s390/block/dasd_genhd.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
> index fa966e0db6ca..ba07022283bc 100644
> --- a/drivers/s390/block/dasd_genhd.c
> +++ b/drivers/s390/block/dasd_genhd.c
> @@ -33,7 +33,7 @@ int dasd_gendisk_alloc(struct dasd_block *block)
>  {
>  	struct gendisk *gdp;
>  	struct dasd_device *base;
> -	int len;
> +	int len, rc;
>  
>  	/* Make sure the minor for this device exists. */
>  	base = block->base;
> @@ -79,7 +79,11 @@ int dasd_gendisk_alloc(struct dasd_block *block)
>  	dasd_add_link_to_gendisk(gdp, base);
>  	block->gdp = gdp;
>  	set_capacity(block->gdp, 0);
> -	device_add_disk(&base->cdev->dev, block->gdp, NULL);
> +
> +	rc = device_add_disk(&base->cdev->dev, block->gdp, NULL);
> +	if (rc)
> +		return rc;
> +

I think, just like with some of the other changes, there is some
cleanup required before returning. I'll prepare a patch and
come back to you.

>  	return 0;
>  }
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ