Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp595122pxb; Thu, 2 Sep 2021 10:42:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy86PA7JeVOTZRcu1GN0Tc48BiN9tontFKMV/O2a4HSxtZHd6wmuDbmmtfhqGAz5w0cZYDx X-Received: by 2002:a92:d6c7:: with SMTP id z7mr3353697ilp.4.1630604569557; Thu, 02 Sep 2021 10:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630604569; cv=none; d=google.com; s=arc-20160816; b=EkFGmnAy4CASkkNRdVl/vrAQsA450UCr/Muex7Kzs32/Em5eDH5vqrHkgHaZaTEsum LztPTK7m7b0UoJh+lCZb9o6muHNgE3Ww79Xbsp272FIFJThz6BuEpjPFNznCCtjiOANE bWJC4byzSKkMVWdXxLbvXapwuFZ0TXR5eEcL10K8FMNwM/ZJz0VsAQ0Tbb5uQhB6ec0m q0uWH66vYsrKyO4H/UyFZc1tNXHWb5gdGkL5BpQZT7tESohi3eTxhj2707z2JrfWYj9Z hUv7PnpTLMHpfL4FoJMOqQClUKuXsetOyE9M/6OW6PGdCd+6XV3zF3FFyDtYeHnYMm/t MsrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7V8FZ80qIliivCO2ypIuGl2Awrc5ZK57tRJ4fo+fTPQ=; b=XL+zPyfckca9y4xxS8XpU6DI37fnl6kT6o4SXAAiSwA8KQodpKw0uiLktJ/6ujCM6I LeJEGNSwCtLbGca75LBZ5SJdT3wVn8QP3+9DNKVdJfXP6FnypnD8aFCYUIcSyVrDMmh+ M3yUznMh+3TkXD0H3/ptNqo9j+05ztnkKHOJnIdxrog8bTWB6BoawkSsFXVV/eG0Tdgk lc0CAM8k1fWtJTWZ0CfhH/kK8Cq3iJDlugv+pcqFDLv6Y8Oxmd8SmkARzvdzuTZpqDvT VUZeXp3AiAs0ypRXVNs5cta0rZJ1qMx3nAkP9T0OGQe5FR6DaG0PTmTZWGAHh2XJ8KYS MqhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=kjbVAj8y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si3047847ile.140.2021.09.02.10.42.36; Thu, 02 Sep 2021 10:42:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=kjbVAj8y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347058AbhIBRme (ORCPT + 99 others); Thu, 2 Sep 2021 13:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346791AbhIBRmR (ORCPT ); Thu, 2 Sep 2021 13:42:17 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFD7CC061757; Thu, 2 Sep 2021 10:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=7V8FZ80qIliivCO2ypIuGl2Awrc5ZK57tRJ4fo+fTPQ=; b=kjbVAj8y8kqrHOxzh5HG+PkbB9 Y6I1Ri0p1OX8ZojE1JOAtx4zNb9br0bIT6kKcK0pwb43OF/nWHFc+nzS0JUAXe3mIT6QK9s5vu4ue fVEEbUgJeTgtw4VwPNvigT+lKIU6Dc8233ERbzZkIIXiwvWz4Hyfz6tf4LrQ28A1u9dDSaA6rYFq9 35uMQ4WV2bbPVzdnA4rPEVZgLiAh6l2P8UTq9MmGpEaNGRNmvPKTLrfXBUgdDd1mjX1O5JxBV7YmM e8r3pzUqdi2C5GoAQ05/qJlFjCC4Bdm93rQ4fhe1239c5f20fXZ37R5oExtjYihS2xkkljbg05j1x Sjh2fZXQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLqi2-00A9FS-An; Thu, 02 Sep 2021 17:41:06 +0000 From: Luis Chamberlain To: axboe@kernel.dk, gregkh@linuxfoundation.org, chaitanya.kulkarni@wdc.com, atulgopinathan@gmail.com, hare@suse.de, maximlevitsky@gmail.com, oakad@yahoo.com, ulf.hansson@linaro.org, colin.king@canonical.com, shubhankarvk@gmail.com, baijiaju1990@gmail.com, trix@redhat.com, dongsheng.yang@easystack.cn, ceph-devel@vger.kernel.org, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, sth@linux.ibm.com, hoeppner@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, oberpar@linux.ibm.com, tj@kernel.org Cc: linux-s390@vger.kernel.org, linux-mtd@lists.infradead.org, linux-mmc@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH 9/9] s390/block/xpram: add error handling support for add_disk() Date: Thu, 2 Sep 2021 10:41:05 -0700 Message-Id: <20210902174105.2418771-10-mcgrof@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210902174105.2418771-1-mcgrof@kernel.org> References: <20210902174105.2418771-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 --- drivers/s390/block/xpram.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c index ce98fab4d43c..ed3904b6a9c8 100644 --- a/drivers/s390/block/xpram.c +++ b/drivers/s390/block/xpram.c @@ -371,7 +371,9 @@ static int __init xpram_setup_blkdev(void) disk->private_data = &xpram_devices[i]; sprintf(disk->disk_name, "slram%d", i); set_capacity(disk, xpram_sizes[i] << 1); - add_disk(disk); + rc = add_disk(disk); + if (rc) + goto out; } return 0; -- 2.30.2