All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: axboe@kernel.dk, justin@coraid.com, geert@linux-m68k.org,
	ulf.hansson@linaro.org, hare@suse.de, tj@kernel.org,
	philipp.reisner@linbit.com, lars.ellenberg@linbit.com,
	jdike@addtoit.com, richard@nod.at,
	anton.ivanov@cambridgegreys.com, johannes.berg@intel.com,
	chris.obbard@collabora.com, krisman@collabora.com,
	zhuyifei1999@gmail.com, thehajime@gmail.com, chris@zankel.net,
	jcmvbkbc@gmail.com, tim@cyberelk.net
Cc: linux-xtensa@linux-xtensa.org, linux-um@lists.infradead.org,
	linux-m68k@lists.linux-m68k.org, drbd-dev@lists.linbit.com,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH v2 15/15] pd: add error handling support for add_disk()
Date: Mon, 27 Sep 2021 15:01:10 -0700	[thread overview]
Message-ID: <20210927220110.1066271-16-mcgrof@kernel.org> (raw)
In-Reply-To: <20210927220110.1066271-1-mcgrof@kernel.org>

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@kernel.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..e59759bcf416 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->gd);
 put_disk:
 	put_disk(p);
 	disk->gd = NULL;
-- 
2.30.2


  parent reply	other threads:[~2021-09-27 22:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 22:00 [PATCH v2 00/15] block: third batch of add_disk() error handling conversions Luis Chamberlain
2021-09-27 22:00 ` [PATCH v2 01/15] z2ram: add error handling support for add_disk() Luis Chamberlain
2021-09-27 22:00 ` [PATCH v2 02/15] aoe: " Luis Chamberlain
2021-09-27 22:00 ` [PATCH v2 03/15] m68k/emu/nfblock: " Luis Chamberlain
2021-09-27 22:00 ` [PATCH v2 04/15] drbd: " Luis Chamberlain
2021-09-27 22:01 ` [PATCH v2 05/15] um/drivers/ubd_kern: " Luis Chamberlain
2021-09-27 22:01 ` [PATCH v2 06/15] xtensa/platforms/iss/simdisk: " Luis Chamberlain
2021-09-27 22:50   ` Max Filippov
2021-09-27 23:24     ` Jens Axboe
2021-09-27 22:01 ` [PATCH v2 07/15] n64cart: " Luis Chamberlain
2021-09-27 22:01 ` [PATCH v2 08/15] pcd: move the identify buffer into pcd_identify Luis Chamberlain
2021-09-27 22:01 ` [PATCH v2 09/15] pcd: cleanup initialization Luis Chamberlain
2021-09-27 22:01 ` [PATCH v2 10/15] pf: " Luis Chamberlain
2021-09-27 22:01 ` [PATCH v2 11/15] pd: " Luis Chamberlain
2021-09-27 22:01 ` [PATCH v2 12/15] pcd: add error handling support for add_disk() Luis Chamberlain
2021-09-27 22:01 ` [PATCH v2 13/15] pcd: fix ordering of unregister_cdrom() Luis Chamberlain
2021-09-27 22:01 ` [PATCH v2 14/15] pcd: capture errors on cdrom_register() Luis Chamberlain
2021-09-27 22:01 ` Luis Chamberlain [this message]
2021-09-27 22:29 ` [PATCH v2 00/15] block: third batch of add_disk() error handling conversions Jens Axboe

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=20210927220110.1066271-16-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=axboe@kernel.dk \
    --cc=chris.obbard@collabora.com \
    --cc=chris@zankel.net \
    --cc=drbd-dev@lists.linbit.com \
    --cc=geert@linux-m68k.org \
    --cc=hare@suse.de \
    --cc=jcmvbkbc@gmail.com \
    --cc=jdike@addtoit.com \
    --cc=johannes.berg@intel.com \
    --cc=justin@coraid.com \
    --cc=krisman@collabora.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-um@lists.infradead.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=philipp.reisner@linbit.com \
    --cc=richard@nod.at \
    --cc=thehajime@gmail.com \
    --cc=tim@cyberelk.net \
    --cc=tj@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=zhuyifei1999@gmail.com \
    /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.