From patchwork Wed Sep 1 21:00:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 1523404 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=QSOwcCP7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H0GhH0RDxz9sCD for ; Thu, 2 Sep 2021 07:01:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ATlLFv6aWmfNKv7tGW5FC2V9Xy/VtCzt6wCxGe+nqu4=; b=QSOwcCP7rLSjcq G9t7z30q1F/EzIU7ByeD8A2DezZ9Qti/z9i1v4Or2kZUCjq7wYWiIl882kGcYbbfFuh7fmvleU8qG bFDKIejnoHIfB0xMWrZN4iXEsP8AJ3gOtMzOyuT62LVRsukWGEhU/itqBA57u95iRFRyL7EOUfO3T 8XjeV0L8M038ZlHSSar8cLVFDZQxaMBRE39tSgGiF8o3cFlwf7NwoYpvlBLXrPxyhHboUqxoiyOoV wdw40yT74MGEG1KQMjr/sfMGssEF9DUiu+Ox6hSjqNG96rSrGpkkt5b05exQH1Zq3PvPQcKLyLEET 2V59Y0yVpNO8RVOIzOBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLXM9-007LfJ-9X; Wed, 01 Sep 2021 21:01:13 +0000 Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLXLR-007LW9-E5; Wed, 01 Sep 2021 21:00:29 +0000 From: Luis Chamberlain To: axboe@kernel.dk, bhelgaas@google.com, liushixin2@huawei.com, thunder.leizhen@huawei.com, lee.jones@linaro.org, geoff@infradead.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, jim@jtan.com, haris.iqbal@ionos.com, jinpu.wang@ionos.com, josh.h.morris@us.ibm.com, pjk1939@linux.ibm.com, tim@cyberelk.net, richard@nod.at, miquel.raynal@bootlin.com, vigneshr@ti.com Cc: linux-mtd@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH 04/10] ps3vram: add error handling support for add_disk() Date: Wed, 1 Sep 2021 14:00:22 -0700 Message-Id: <20210901210028.1750956-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210901210028.1750956-1-mcgrof@kernel.org> References: <20210901210028.1750956-1-mcgrof@kernel.org> MIME-Version: 1.0 X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.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 --- 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);