Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2359939lqp; Sun, 24 Mar 2024 15:39:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcDgTBUefbL8v46eLIpCSvDlx6lrVpResRj5UXYsLpmgSV1EroBgM7ruFq8nHZ4NMox88Rk2zenuwyqKBDb7H21o1ru2Di6Lhldye5Og== X-Google-Smtp-Source: AGHT+IHX7TeW5KV5apVjMzABooKD4/HQYsKsE4Ojwe9DoxQoxFEonOZ4N3+Vg0VMrjcUxpat6AwR X-Received: by 2002:a05:622a:110:b0:430:e4c9:ccae with SMTP id u16-20020a05622a011000b00430e4c9ccaemr5472605qtw.60.1711319972400; Sun, 24 Mar 2024 15:39:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711319972; cv=pass; d=google.com; s=arc-20160816; b=ixkX/jCkdY93lBurjFIOWTa/OILXMdzfxoUmou5/DK+z/ov0b/KZ+Rliyp3z0KeP+h X3M9p/H4o5Z6CRsfbt40fYLqNRJ6dVtiVp+cIXJ04KulwjCKuxpgAsRmU/jXwgOiIHpp lgpnTK9Mgl7ae3hJz+GUbs+HTjhXy7+F2JO7iE7FvoalTB7ewMmjnSI/nmATOem4CYsD WvGNy4K2kJPfHJMZ2CZF2lOp1ag58KtVVByGN1qrRef45rIpWzGmqCo627QczffoC0N+ mEZ6ZlUUbYRGTLRTzVJTV7Knqe3bLZd1OaXqIHeSG/e97D3+M3DtcAT8C5w6k9QzQfFY WvbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Rr5BuSnYc6+JrB4uds9g00Zdv84Nz7vfS5fCT+DUYcU=; fh=++kMUPzojOevoFPqkAYcEUA3ExBjQzAARDRdPEpA+nE=; b=Zoa4aKFzxDukyiESjGrsnacYDCIWfMEKab6B/ktq8UoJ8c5bbKpDANe+pPtrWTfuQq 1NilkjUyD0xIog7u0KWmz28QzWjrAJYJKTjO/eoOal8kkTVdnP1+f8oQt1G/SQvHnclW TXClVlE96f0CF5O9Z2I08tNloF5lyC9rBM+305QgohM4h78zbedkPzyxVXLaOOaT4dJz zLxC7EnE0+7CBi6/88iYS9ymx+kdABq9D3acvAXGgS2EPeBnQw1lzx6s4Q8Qc0ZONGT0 duR1rUU4Pf1Yf9Nx6hvcUzZSooCsK2LQaRJIsCxyzQDwg1zgJ2rDax0I3VdzYt5cQlyd budg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VCgyDxaC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112904-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112904-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id q16-20020a05622a04d000b004313ae19b00si4220506qtx.388.2024.03.24.15.39.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 15:39:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112904-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VCgyDxaC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112904-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112904-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0C8D81C210D5 for ; Sun, 24 Mar 2024 22:39:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 914555A10A; Sun, 24 Mar 2024 22:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VCgyDxaC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACA8759B4A; Sun, 24 Mar 2024 22:35:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319714; cv=none; b=UgO6e5ZctkRztbsfEjPe48yIZNwnlaAhPnjKCqHows5FZIyvP+Uq2nfKtUAIEoXQy47SyKVd+ncp4MjJvJ0p7pxwiTpacdcJ+HetFYMnXt7V/RC3DAiiWCuksrTijYWRhRXifc3TeAB7kbSGMp7IYiiT+pwOABZ46Uw90H3pTss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319714; c=relaxed/simple; bh=oVZwtmDcHYvBHMhU9YZMSDC5oMFaskHjpmfI0C7pr9E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KaWrOCItd37zwX2arrCQqriefagos/qReDVbQk1QmiJr9ZIMnUfonvKPpPQWWnU7+lDVjP2m3rndAb0UzksO8az8Wr/Nh8h2k00nunFevr13h6wZbbG6yUKqFMjTRaisskBb2NOi/icwjf9kLPdZ58N/pvN66Gf3j4Xz4Gl/DCE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VCgyDxaC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADBC4C43394; Sun, 24 Mar 2024 22:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319714; bh=oVZwtmDcHYvBHMhU9YZMSDC5oMFaskHjpmfI0C7pr9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VCgyDxaCGYOtfhbTrVyM81alx4oS9oxFc0r5pft3B4wnvUw/Dt3bF715kKUf/a7Az QS9EJoon1Qh0Gx2bjEJgyatMeuzyS1yEsDo0+jUIyGRGzJukJRAjO99HdkEO8Nu3Gq T4n6OAex5chsqxHeKJGtCrZa4DJxjl9FYUkQ7JKxEt+AUdFcGM2TDWa88BwiySS0oL VMM8dy+8sofL/X9yfxY2vCfhp08SQBCfI8M3HqSVZMacXWJNUDV9roi2BUqvAC3Al2 g5caA9rwnF4MwGmVf3jKvIUn+1LQpptmJQE6omGidEsNBLSZk66dlWnpuszClFMpY+ 9xB2CvSXSrwjw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Miroslav Franc , =?UTF-8?q?Jan=20H=C3=B6ppner?= , Stefan Haberland , Jens Axboe , Sasha Levin Subject: [PATCH 6.8 017/715] s390/dasd: fix double module refcount decrement Date: Sun, 24 Mar 2024 18:23:16 -0400 Message-ID: <20240324223455.1342824-18-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Miroslav Franc [ Upstream commit c3116e62ddeff79cae342147753ce596f01fcf06 ] Once the discipline is associated with the device, deleting the device takes care of decrementing the module's refcount. Doing it manually on this error path causes refcount to artificially decrease on each error while it should just stay the same. Fixes: c020d722b110 ("s390/dasd: fix panic during offline processing") Signed-off-by: Miroslav Franc Signed-off-by: Jan Höppner Signed-off-by: Stefan Haberland Link: https://lore.kernel.org/r/20240209124522.3697827-3-sth@linux.ibm.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/s390/block/dasd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 4a7d70426a6e6..30851faade97b 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -3524,12 +3524,11 @@ int dasd_generic_set_online(struct ccw_device *cdev, dasd_delete_device(device); return -EINVAL; } + device->base_discipline = base_discipline; if (!try_module_get(discipline->owner)) { - module_put(base_discipline->owner); dasd_delete_device(device); return -EINVAL; } - device->base_discipline = base_discipline; device->discipline = discipline; /* check_device will allocate block device if necessary */ @@ -3537,8 +3536,6 @@ int dasd_generic_set_online(struct ccw_device *cdev, if (rc) { dev_warn(dev, "Setting the DASD online with discipline %s failed with rc=%i\n", discipline->name, rc); - module_put(discipline->owner); - module_put(base_discipline->owner); dasd_delete_device(device); return rc; } -- 2.43.0