[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YS/Ws2iD1suaut39@bombadil.infradead.org>
Date: Wed, 1 Sep 2021 12:38:27 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: axboe@...nel.dk, justin@...aid.com, geert@...ux-m68k.org,
ulf.hansson@...aro.org, hare@...e.de, tj@...nel.org,
philipp.reisner@...bit.com, lars.ellenberg@...bit.com,
jdike@...toit.com, richard@....at, anton.ivanov@...bridgegreys.com,
johannes.berg@...el.com, chris.obbard@...labora.com,
krisman@...labora.com, zhuyifei1999@...il.com, thehajime@...il.com,
chris@...kel.net, jcmvbkbc@...il.com, tim@...erelk.net
Cc: linux-xtensa@...ux-xtensa.org, linux-um@...ts.infradead.org,
linux-m68k@...ts.linux-m68k.org, drbd-dev@...ts.linbit.com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 15/15] pd: add error handling support for add_disk()
On Mon, Aug 30, 2021 at 03:10:00PM -0700, 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/block/paride/pd.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
> index 500b89a4bdaf..226ed5c93b68 100644
> --- a/drivers/block/paride/pd.c
> +++ b/drivers/block/paride/pd.c
> @@ -938,8 +938,12 @@ static int pd_probe_drive(struct pd_unit *disk, int autoprobe, int port,
> if (ret)
> goto put_disk;
> set_capacity(disk->gd, disk->capacity);
> - add_disk(disk->gd);
> + ret = add_disk(disk->gd);
> + if (ret)
> + goto cleanup_disk;
> return 0;
> +cleanup_disk:
> + blk_cleanup_disk(&disk);
This should be blk_cleanup_disk(disk->gd); Will fix up in my v2.
Luis
Powered by blists - more mailing lists