Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp4390pxb; Thu, 2 Sep 2021 17:41:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEu2o584S5+OGw0ZARXnP+zTjVi4BEn86FLclOr9d5V0E76h0D9yygcPQXSD3RRA5DS4ts X-Received: by 2002:a92:c785:: with SMTP id c5mr618023ilk.224.1630629702585; Thu, 02 Sep 2021 17:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630629702; cv=none; d=google.com; s=arc-20160816; b=BpSdg2XHRdXAlDEjjwNQKOxXdmj8Gfb0/OuW7wbaB74Q6zMAGtpKXLfZ2BykTNXtkA dknJD+uMZ/tgBcNDLQiOlwZE7mr93GK+LfHs9qtIomqgoFU5FZul1m8/0oKRhfOI9Hs2 3F7cr8sjN1Vk4OJv1Rh67SSMrdL98Jn5Nm9R1vRFycxhSXnKo7ZJJt0gdWiHSN5mmG7d NT+6lLzUnsb19k1BEcvR5Wu006McvTmKsvQT1lqcZb4UBK9oYNtZjeo7q9sUiXwD8uzw 5pNlANCg5RvWZJfeVyI427/PLpCotPXf6qzDlF+Ayf8PJOdmSfYeQB2Qo81JUyGmhtyc 16IQ== 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=7TDsKeD7IxDkEhHV9HOPpdDxKioqknLkF46unKTn3WM=; b=sLWIHqQ6Tie2/lYxjqLv9D6lpi5PHPSLpg59KcQ42kE12iPLSs2/tFt2H0hyT2dEag aSMNx2Rr0Dd2wkjYFoNUAC8auu4mhvn61wt+wl/FnsaRlnrGPy1lqnTozQw5YCgAU9IO 9kjGxgykEO0xQxM7MuHcACCRq3Jgka5Vfj9PLymy8LIPnHY9tH6GhOUtT73bC31JEjVx frv3TEUaB/dZ3UmVTRqaqhJbftLcy91/OW1KpIYdFvtwTcEKc6C5zdcfXglS2py/4gml OvxNB+f0b74WrPh5OROaUXu5Ot6xEOpisHnNyyESXE8yOlkr+OPZp1lx0h7JiiDXTooj V2qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xGYAM35r; 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 h5si4045882iol.44.2021.09.02.17.41.31; Thu, 02 Sep 2021 17:41:42 -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=xGYAM35r; 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 S1347243AbhIBRnO (ORCPT + 99 others); Thu, 2 Sep 2021 13:43:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347006AbhIBRmT (ORCPT ); Thu, 2 Sep 2021 13:42:19 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1802C061760; Thu, 2 Sep 2021 10:41:20 -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=7TDsKeD7IxDkEhHV9HOPpdDxKioqknLkF46unKTn3WM=; b=xGYAM35rDyzjVTq3BtdHLJZNPa j52bS1QcvGAYD81BWsYGdnk0y7caLpFkD7gameTc07LEGg13lAHLs7Gt9yW5GJcb9nAndjLcUTA/v /wG8U+2Dic+ZvEicKho6RS5Hf838hdyO4xBDR8UC5blVVZc+1ZpjRs8HIB4zGBweYMYHOdqzm0W9y 0gN4bSw+yuQu3XxYJTKSsXXMtXg/HRuk0MxSW0s1EVwv4MQ48FW9pU9eexzUxX+y2/IUx80vLGDvp urAq0lK6TDcTP/JDPaLLXD+qJ+rOLFNE01UbQdwZHJVAkoQIll07INbEDxpLnAh8ubGfh8fin25nF yrZ6wufA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLqi2-00A9FO-8J; 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 7/9] s390/block/dcssblk: add error handling support for add_disk() Date: Thu, 2 Sep 2021 10:41:03 -0700 Message-Id: <20210902174105.2418771-8-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/dcssblk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 5be3d1c39a78..b0fd5009a12e 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -696,7 +696,9 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char } get_device(&dev_info->dev); - device_add_disk(&dev_info->dev, dev_info->gd, NULL); + rc = device_add_disk(&dev_info->dev, dev_info->gd, NULL); + if (rc) + goto put_dev; switch (dev_info->segment_type) { case SEG_TYPE_SR: -- 2.30.2