Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp638169lqt; Fri, 19 Apr 2024 06:25:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVkBO1afcBKmGsLQxf7+8YVwh/RmFuBSvliGFDmDoPvlz1Px3FzmZIT/mbiByB63m0dGT2rS0aUN6BeVzBs90gI5srfzX53EUo7koOXQ== X-Google-Smtp-Source: AGHT+IH9J3lr46IMDi+MOURjXWDdajPiAF1CTm8pntrToKM7cOsEdTETqVfvsoWEgNlcBfmuaJQ0 X-Received: by 2002:a17:906:f8da:b0:a55:6534:8035 with SMTP id lh26-20020a170906f8da00b00a5565348035mr1971988ejb.11.1713533144517; Fri, 19 Apr 2024 06:25:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713533144; cv=pass; d=google.com; s=arc-20160816; b=kPdWVq2/E2K8cPQNeMUfF0nj31Z481L8bpDUZD+uJkc/gYM5LuhspvEbeJW3Wnejar RGWxwcOOKyM2QyejM3nSwMI77J5gO0n5pzFwo3vJ1jVy0Q8CC2S77cjGKwFvtUNckOhl DhAmK4O6hJdsBDL2wqNrg/1RXV4RBXhoOq9vFZOfXveML2ABqTaMJFDBSkiq7vnXctic pFuRvM8vWWqNY0DmS+FYYvKcDME62q3t6eHVzDzapddHFFBm/BAwh4FWmWhUHkI1DUzM gGQk4p6fT0qq3TYZwCV4MB7yH0KOpBAUck+nhaTHLb3yD41WA2qIpgHUlave7U2YVZJj uJCA== 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=OquLsmPZLgQdNvdRfcQqVZOgi9jZ8SYqH65xHdO5f8w=; fh=+tnAokH00/I9bmSlyeHYHInxsGZT1KtyYKQGINnckgU=; b=qJ1JT/WWYq+5EbBCRwQHs80rqvoQdiRjjzA2/0U3UFk//XqaTZsv0i/z6p7yr5sgDU 7jBqpi2IVSFeYhiO9vYd/AM0zHhLoE99wrcAXT3cmo/idkhAOSO/EWjfHtaXxkveW6CK ilGE7DRvGEWt1T1i0hmz9QhFsBgzFKYND+covpDXDCYeGWu2G7DlTLTmL0Ip0t74Mj9Q xjpz8ssQpl4pjBx+beqFpBtagmseKCrXwCT7F9DTCllh0T8PNsSkfM/9IFAGLY8FYq4d BbcJfm9/H3TY1Oyxw0CMDBIpaPCvXhkPV78h+ebHruYWTSXVSsTyjKYrCErmm29h39x0 mFyQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VezHzNXr; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-151466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z23-20020a170906075700b00a55679a9eafsi2026183ejb.332.2024.04.19.06.25.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 06:25:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VezHzNXr; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-151466-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151466-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 42E181F2343C for ; Fri, 19 Apr 2024 13:25:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CEFD6129E81; Fri, 19 Apr 2024 13:25:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VezHzNXr" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 99632128806 for ; Fri, 19 Apr 2024 13:25:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713533127; cv=none; b=Oy4Hr/VjfX/IYoiZUJXljsgH6cvMKc3JC2vpkjuvENBD2Uc62lUQ4mx2tAnQbbjj7Mpst9Ag9FRHbp6br3Kz0NW322VPc4apfUk/1g43JDkCtrX619h38cwqk8Uh148W5RnZpKQbdEBHKw+lHFW/EA0OBCJEuVnFU9Jghmi0Egs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713533127; c=relaxed/simple; bh=RkC57Q7UJKwDbV5ZOymkImc73C43dsfw8U713gEUT98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NimRvWxAyaXrgyQ+ItmkFS77+rWGQdUTLHTz9emUK6LOgq3jK6aczhdmMCMbA0MVGRDQ0SqtlFal/Pk/SI9QBmhncxsajeT6s41+NZiZ4yQEnXxe+5f7+cTjYY5xk7+L7At6jdEbpvIV8z5zCDpKoKzBMmHf8+P28eHm4eK1Dxw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VezHzNXr; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713533123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OquLsmPZLgQdNvdRfcQqVZOgi9jZ8SYqH65xHdO5f8w=; b=VezHzNXrNAGlFNH71SSPZGy+kuOW1S4ChuEGAEHl4ubxYoz7ai3HI4dlM6vYLxJK8b6SX3 dciviTbgbte2JE6Z0rLj+PUQmUD6CZcxaA8GvM00PQvj9ic5rY2H5ac7Lo6AuL/fNnwBi+ nkF7WHsy8EavMibPwSFccIQQOSMxB6I= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-438-P4R0S8H_OU-wMgWfzGhtvg-1; Fri, 19 Apr 2024 09:25:18 -0400 X-MC-Unique: P4R0S8H_OU-wMgWfzGhtvg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 336753804516; Fri, 19 Apr 2024 13:25:16 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.22.8.218]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5D0A4EA62; Fri, 19 Apr 2024 13:25:12 +0000 (UTC) From: Wander Lairson Costa To: Brendan Higgins , David Gow , Rae Moar , Matti Vaittinen , Shuah Khan , Greg Kroah-Hartman , Maxime Ripard , linux-kselftest@vger.kernel.org (open list:KERNEL UNIT TESTING FRAMEWORK (KUnit)), kunit-dev@googlegroups.com (open list:KERNEL UNIT TESTING FRAMEWORK (KUnit)), linux-kernel@vger.kernel.org (open list) Cc: Wander Lairson Costa Subject: [PATCH v4 1/2] kunit: unregister the device on error Date: Fri, 19 Apr 2024 10:25:01 -0300 Message-ID: <20240419132504.9488-2-wander@redhat.com> In-Reply-To: <20240419132504.9488-1-wander@redhat.com> References: <20240419132504.9488-1-wander@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 kunit_init_device() should unregister the device on bus register error, but mistakenly it tries to unregister the bus. Unregister the device instead of the bus. Signed-off-by: Wander Lairson Costa Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") --- lib/kunit/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kunit/device.c b/lib/kunit/device.c index abc603730b8e..25c81ed465fb 100644 --- a/lib/kunit/device.c +++ b/lib/kunit/device.c @@ -51,7 +51,7 @@ int kunit_bus_init(void) error = bus_register(&kunit_bus_type); if (error) - bus_unregister(&kunit_bus_type); + root_device_unregister(kunit_bus_device); return error; } -- 2.44.0