Commit 3c30883a authored by Luis Chamberlain's avatar Luis Chamberlain Committed by Jens Axboe

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: default avatarLuis Chamberlain <mcgrof@kernel.org>
Acked-by: default avatarGeoff Levand <geoff@infradead.org>
Link: https://lore.kernel.org/r/20211015235219.2191207-12-mcgrof@kernel.orgSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ff4cbe0f
...@@ -753,9 +753,14 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev) ...@@ -753,9 +753,14 @@ static int ps3vram_probe(struct ps3_system_bus_device *dev)
dev_info(&dev->core, "%s: Using %llu MiB of GPU memory\n", dev_info(&dev->core, "%s: Using %llu MiB of GPU memory\n",
gendisk->disk_name, get_capacity(gendisk) >> 11); 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; return 0;
out_cleanup_disk:
blk_cleanup_disk(gendisk);
out_cache_cleanup: out_cache_cleanup:
remove_proc_entry(DEVICE_NAME, NULL); remove_proc_entry(DEVICE_NAME, NULL);
ps3vram_cache_cleanup(dev); ps3vram_cache_cleanup(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment