From: Luis Chamberlain <mcgrof@kernel.org> To: axboe@kernel.dk, martin.petersen@oracle.com, jejb@linux.ibm.com, kbusch@kernel.org, sagi@grimberg.me, adrian.hunter@intel.com, beanhuo@micron.com, ulf.hansson@linaro.org, avri.altman@wdc.com, swboyd@chromium.org, agk@redhat.com, snitzer@redhat.com, josef@toxicpanda.com Cc: linux-block@vger.kernel.org, bvanassche@acm.org, linux-scsi@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, ming.lei@redhat.com, hch@infradead.org, dm-devel@redhat.com, nbd@other.debian.org, Luis Chamberlain <mcgrof@kernel.org> Subject: [dm-devel] [PATCH 06/10] mmc/core/block: add error handling support for add_disk() Date: Mon, 23 Aug 2021 13:29:26 -0700 [thread overview] Message-ID: <20210823202930.137278-7-mcgrof@kernel.org> (raw) In-Reply-To: <20210823202930.137278-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. The caller cleanups the disk already so all we need to do is just pass along the return value. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> --- drivers/mmc/core/block.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 4c11f171e56d..4f12c6d1e1b5 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2432,7 +2432,9 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, /* used in ->open, must be set before add_disk: */ if (area_type == MMC_BLK_DATA_AREA_MAIN) dev_set_drvdata(&card->dev, md); - device_add_disk(md->parent, md->disk, mmc_disk_attr_groups); + ret = device_add_disk(md->parent, md->disk, mmc_disk_attr_groups); + if (ret) + goto out; return md; err_kfree: -- 2.30.2 -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel
next prev parent reply other threads:[~2021-08-23 21:45 UTC|newest] Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-23 20:29 [dm-devel] [PATCH 00/10] block: first batch of add_disk() error handling conversions Luis Chamberlain 2021-08-23 20:29 ` [dm-devel] [PATCH 01/10] scsi/sd: use blk_cleanup_queue() insted of put_disk() Luis Chamberlain 2021-08-24 5:52 ` Christoph Hellwig 2021-08-27 18:27 ` Luis Chamberlain 2021-08-28 7:26 ` Christoph Hellwig 2021-08-23 20:29 ` [dm-devel] [PATCH 02/10] scsi/sd: add error handling support for add_disk() Luis Chamberlain 2021-08-24 5:58 ` Christoph Hellwig 2021-08-23 20:29 ` [dm-devel] [PATCH 03/10] scsi/sr: use blk_cleanup_disk() instead of put_disk() Luis Chamberlain 2021-08-24 6:00 ` Christoph Hellwig 2021-08-27 18:28 ` Luis Chamberlain 2021-08-23 20:29 ` [dm-devel] [PATCH 04/10] scsi/sr: add error handling support for add_disk() Luis Chamberlain 2021-08-24 6:04 ` Christoph Hellwig 2021-08-23 20:29 ` [dm-devel] [PATCH 05/10] nvme: " Luis Chamberlain 2021-08-24 6:09 ` Christoph Hellwig 2021-08-27 18:32 ` Luis Chamberlain 2021-08-23 20:29 ` Luis Chamberlain [this message] 2021-08-24 6:13 ` [dm-devel] [PATCH 06/10] mmc/core/block: " Christoph Hellwig 2021-08-27 18:42 ` Luis Chamberlain 2021-08-28 7:32 ` Christoph Hellwig 2021-08-30 20:42 ` Luis Chamberlain 2021-08-23 20:29 ` [dm-devel] [PATCH 07/10] md: " Luis Chamberlain 2021-08-24 6:15 ` Christoph Hellwig 2021-08-23 20:29 ` [dm-devel] [PATCH 08/10] dm: add add_disk() error handling Luis Chamberlain 2021-08-24 6:21 ` Christoph Hellwig 2021-08-27 18:55 ` Luis Chamberlain 2021-08-28 7:35 ` Christoph Hellwig 2021-08-30 21:00 ` Luis Chamberlain 2021-08-23 20:29 ` [dm-devel] [PATCH 09/10] loop: add error handling support for add_disk() Luis Chamberlain 2021-08-24 6:25 ` Christoph Hellwig 2021-08-23 20:29 ` [dm-devel] [PATCH 10/10] nbd: " Luis Chamberlain 2021-08-24 6:27 ` Christoph Hellwig
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=20210823202930.137278-7-mcgrof@kernel.org \ --to=mcgrof@kernel.org \ --cc=adrian.hunter@intel.com \ --cc=agk@redhat.com \ --cc=avri.altman@wdc.com \ --cc=axboe@kernel.dk \ --cc=beanhuo@micron.com \ --cc=bvanassche@acm.org \ --cc=dm-devel@redhat.com \ --cc=hch@infradead.org \ --cc=jejb@linux.ibm.com \ --cc=josef@toxicpanda.com \ --cc=kbusch@kernel.org \ --cc=linux-block@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mmc@vger.kernel.org \ --cc=linux-nvme@lists.infradead.org \ --cc=linux-scsi@vger.kernel.org \ --cc=martin.petersen@oracle.com \ --cc=ming.lei@redhat.com \ --cc=nbd@other.debian.org \ --cc=sagi@grimberg.me \ --cc=snitzer@redhat.com \ --cc=swboyd@chromium.org \ --cc=ulf.hansson@linaro.org \ --subject='Re: [dm-devel] [PATCH 06/10] mmc/core/block: add error handling support for add_disk()' \ /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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).