[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211015235219.2191207-12-mcgrof@kernel.org>
Date: Fri, 15 Oct 2021 16:52:17 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: axboe@...nel.dk, geoff@...radead.org, mpe@...erman.id.au,
benh@...nel.crashing.org, paulus@...ba.org, jim@...n.com,
minchan@...nel.org, ngupta@...are.org, senozhatsky@...omium.org,
richard@....at, miquel.raynal@...tlin.com, vigneshr@...com,
dan.j.williams@...el.com, vishal.l.verma@...el.com,
dave.jiang@...el.com, ira.weiny@...el.com, kbusch@...nel.org,
hch@....de, sagi@...mberg.me
Cc: linux-block@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-mtd@...ts.infradead.org, nvdimm@...ts.linux.dev,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH 11/13] ps3vram: add error handling support for add_disk()
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/ps3vram.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index c7b19e128b03..af2a0d09c598 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -755,9 +755,14 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev)
dev_info(&dev->core, "%s: Using %llu MiB of GPU memory\n",
gendisk->disk_name, get_capacity(gendisk) >> 11);
- device_add_disk(&dev->core, gendisk, NULL);
+ error = device_add_disk(&dev->core, gendisk, NULL);
+ if (error)
+ goto out_cleanup_disk;
+
return 0;
+out_cleanup_disk:
+ blk_cleanup_disk(gendisk);
out_cache_cleanup:
remove_proc_entry(DEVICE_NAME, NULL);
ps3vram_cache_cleanup(dev);
--
2.30.2
Powered by blists - more mailing lists