From patchwork Mon Oct 23 03:28:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yilun X-Patchwork-Id: 156657 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1054058vqx; Sun, 22 Oct 2023 20:31:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjjW1W+hxHGn1F46UC3vfA4FslTGro6rQe72a8GzmyCDwfgww8C3LycGzCi0R/+YlK1ur6 X-Received: by 2002:a17:902:e551:b0:1bc:3944:9391 with SMTP id n17-20020a170902e55100b001bc39449391mr6351426plf.25.1698031903031; Sun, 22 Oct 2023 20:31:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698031903; cv=none; d=google.com; s=arc-20160816; b=WJcU43cDqqpqzbK3mcGiKB9uugSNLuCqU+Jpw+Ak5UyztWIAtSZ80lZqVya5L0Ebae l4odb7gEl0Q+3V4K9X7/eLfRZN5eLR7wYJK8LBiV+emU+MGlGSp0MzZJKi4NnVnIifWJ kD53yCQ/sDfvqICSt4HlzXdz2FjuyLVcfR1hyMcxa49u/2EOjdK+Fh+WmDTYEo1XDMPv QIwGMgaT6NjcWWikWaBjadOrjNHTlMUNX1IueCLHAMsxQRu7cvpjPvUfgnon28K0/M7q wGcaILQuYT9ozOgbHocWqD1rvoGcj87j/b2Uei/9FR8XzkFBRqlq36QZkWlDSY727SlU 1bYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SSS8SD7mf2v1YZql50YsoFwgr2wHzvqKMd41I9xPK6A=; fh=/ojXDcZVrVgbTt1FSyfbmYWpNtrCcNZgj/DZ0kIPr78=; b=i8uoXob0aTQLA2hg02Pbs9bqXEgcswdCRH37p6FKGAzDkRdios7rNt1qaLuRCJRDn8 nOBD2WVgV5Un44GF6hEux1ES62PfruroQiFZZAF+cY/Y4fjfEbmS3o4tw9aymwHxNFXK +yonV3QKvHS6OZhri77EdIJvOalBhF/nFmkcyaVAz3yGuKrfZf5WDnaLBcyEZRVLBc6o DjHBD8nd7gvxqfyZVuks5xoRDu5Z7jXByxZNLjYYvlOHdY2EBiETeU1mIifzh9PAWiPb HKF74scqvvhRnQKGRYOjlOMF65eanXSRKQKSd52yrvcx+X8rrB94oqJCx6eiOeme2NSk kpnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="R/stuqen"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x3-20020a170902ea8300b001c9ad30e4b8si5516096plb.320.2023.10.22.20.31.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 20:31:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="R/stuqen"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A969A806AFFC; Sun, 22 Oct 2023 20:31:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233278AbjJWDaw (ORCPT + 26 others); Sun, 22 Oct 2023 23:30:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233392AbjJWDaX (ORCPT ); Sun, 22 Oct 2023 23:30:23 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFC4210CE; Sun, 22 Oct 2023 20:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698031814; x=1729567814; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cbeVU1+sXbzRi3Zrjrq4r+R4+mYuY+Z+kUuHc+fyWyE=; b=R/stuqen7WWUYDV8R8tHersQhVdScPwyp3IuWl3p4VKDb5vF9IQMXSAQ WWE/8dVze2RCDMJuc6YSxfRGuZ8mksOBv0/PCdYL5+Wa8Its1R8rEae+v V0Xul/zHfJQcqu869NiWcUPOeJoi8pv9eWF8Yv/EK90sK6Q/dVoAXdYGw vDCGwJbii/mIKIENcY3Z327lEfl21uHVU1Y7iRPl/5TnfmIFsngsDPAJa QkPhqoHKh019nqJhdLqockxaBHGXW7RgI32JDBRvMjffM+oLSwtAqVn5m a8cA8/6MS7dAmxmiEmtf6aHEe5yEVclZJD/7vsFjdFtLgHcLHiRg2w2D/ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10871"; a="5380107" X-IronPort-AV: E=Sophos;i="6.03,244,1694761200"; d="scan'208";a="5380107" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2023 20:30:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10871"; a="881617671" X-IronPort-AV: E=Sophos;i="6.03,244,1694761200"; d="scan'208";a="881617671" Received: from yilunxu-optiplex-7050.sh.intel.com ([10.239.159.165]) by orsmga004.jf.intel.com with ESMTP; 22 Oct 2023 20:30:10 -0700 From: Xu Yilun To: gregkh@linuxfoundation.org Cc: hao.wu@intel.com, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, yilun.xu@intel.com Subject: [RESEND PATCH 1/2] fpga: m10bmc-sec: Change contact for secure update driver Date: Mon, 23 Oct 2023 11:28:56 +0800 Message-Id: <20231023032857.902699-2-yilun.xu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231023032857.902699-1-yilun.xu@linux.intel.com> References: <20231023032857.902699-1-yilun.xu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 22 Oct 2023 20:31:21 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780515500868683464 X-GMAIL-MSGID: 1780515500868683464 From: Russ Weight Change the maintainer for the Intel MAX10 BMC Secure Update driver from Russ Weight to Peter Colberg. Update the ABI documentation contact information as well. Signed-off-by: Russ Weight Acked-by: Peter Colberg Link: https://lore.kernel.org/r/20230928164753.278684-1-russell.h.weight@intel.com Signed-off-by: Xu Yilun --- .../testing/sysfs-driver-intel-m10-bmc-sec-update | 14 +++++++------- MAINTAINERS | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-driver-intel-m10-bmc-sec-update b/Documentation/ABI/testing/sysfs-driver-intel-m10-bmc-sec-update index 0a41afe0ab4c..9051695d2211 100644 --- a/Documentation/ABI/testing/sysfs-driver-intel-m10-bmc-sec-update +++ b/Documentation/ABI/testing/sysfs-driver-intel-m10-bmc-sec-update @@ -1,7 +1,7 @@ What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/sr_root_entry_hash Date: Sep 2022 KernelVersion: 5.20 -Contact: Russ Weight +Contact: Peter Colberg Description: Read only. Returns the root entry hash for the static region if one is programmed, else it returns the string: "hash not programmed". This file is only @@ -11,7 +11,7 @@ Description: Read only. Returns the root entry hash for the static What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/pr_root_entry_hash Date: Sep 2022 KernelVersion: 5.20 -Contact: Russ Weight +Contact: Peter Colberg Description: Read only. Returns the root entry hash for the partial reconfiguration region if one is programmed, else it returns the string: "hash not programmed". This file @@ -21,7 +21,7 @@ Description: Read only. Returns the root entry hash for the partial What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/bmc_root_entry_hash Date: Sep 2022 KernelVersion: 5.20 -Contact: Russ Weight +Contact: Peter Colberg Description: Read only. Returns the root entry hash for the BMC image if one is programmed, else it returns the string: "hash not programmed". This file is only visible if the @@ -31,7 +31,7 @@ Description: Read only. Returns the root entry hash for the BMC image What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/sr_canceled_csks Date: Sep 2022 KernelVersion: 5.20 -Contact: Russ Weight +Contact: Peter Colberg Description: Read only. Returns a list of indices for canceled code signing keys for the static region. The standard bitmap list format is used (e.g. "1,2-6,9"). @@ -39,7 +39,7 @@ Description: Read only. Returns a list of indices for canceled code What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/pr_canceled_csks Date: Sep 2022 KernelVersion: 5.20 -Contact: Russ Weight +Contact: Peter Colberg Description: Read only. Returns a list of indices for canceled code signing keys for the partial reconfiguration region. The standard bitmap list format is used (e.g. "1,2-6,9"). @@ -47,7 +47,7 @@ Description: Read only. Returns a list of indices for canceled code What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/bmc_canceled_csks Date: Sep 2022 KernelVersion: 5.20 -Contact: Russ Weight +Contact: Peter Colberg Description: Read only. Returns a list of indices for canceled code signing keys for the BMC. The standard bitmap list format is used (e.g. "1,2-6,9"). @@ -55,7 +55,7 @@ Description: Read only. Returns a list of indices for canceled code What: /sys/bus/platform/drivers/intel-m10bmc-sec-update/.../security/flash_count Date: Sep 2022 KernelVersion: 5.20 -Contact: Russ Weight +Contact: Peter Colberg Description: Read only. Returns number of times the secure update staging area has been flashed. Format: "%u". diff --git a/MAINTAINERS b/MAINTAINERS index b19995690904..6f627a12ef9f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10700,7 +10700,7 @@ F: drivers/mfd/intel-m10-bmc* F: include/linux/mfd/intel-m10-bmc.h INTEL MAX10 BMC SECURE UPDATES -M: Russ Weight +M: Peter Colberg L: linux-fpga@vger.kernel.org S: Maintained F: Documentation/ABI/testing/sysfs-driver-intel-m10-bmc-sec-update From patchwork Mon Oct 23 03:28:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yilun X-Patchwork-Id: 156656 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1053843vqx; Sun, 22 Oct 2023 20:31:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFU7+6u5HNlMx75S0hX/m+5Ha16fZfoNhATWfW/ZnnnceDhVA6hIgJKJgivRqvaZe7BgEFz X-Received: by 2002:aca:1319:0:b0:3a7:5611:a53b with SMTP id e25-20020aca1319000000b003a75611a53bmr8821977oii.0.1698031867342; Sun, 22 Oct 2023 20:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698031867; cv=none; d=google.com; s=arc-20160816; b=TJLRjb6oqjNYUN7MKV9nRY6Cb0kXCFidr50oHeE+UaSTlDHS+H8DlWl6wifqy4XIT1 lfShyOgaMnqNFW3bv+Ocn57WDYiOKlwHuPfaSv7YLjJipO7rSEo4KXJs6XAnbytoYQpR WpkwzBlanp7JWmR+UmnVVkZEbfsUUBSl5iqUQmI5B8AjIBesln28x0ppEh/dnhjOxIdO ZIAkrgLfDBGggJuMTgnUIeq0UXJ0GIBlSpMuQ1F9tFNM+3TFxm7LsVnen53A9uWYHnaO DhPHdndsw7IOyTbUWbQxhqOS9fMfuLfzNEL5f5f/pOMjZZBlGFqnqEdV2EO6GaF7EY+d avtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r1eSsUtgNFTx9zw1mXqh3E4xUF8sywBRe5upPA+Z8yQ=; fh=/ojXDcZVrVgbTt1FSyfbmYWpNtrCcNZgj/DZ0kIPr78=; b=e90/V203OqMkq/rCusVU7nKbY6BOVvhF9tFnHbl14p7vaWGWAm69vPlnGYJ02gcO93 Qc6b/eIgCK+3PTTQZ6UXudK1gFuKHoTzWGzTkfzhCxdqEao2q3buZVpvc1HvKY3WeNUg 6f8dQqYhdh68f4tkuBak7pFY/TOaNcBfNdFowKBXlaCLRBostlXSML5mkZ5aMS39u9LN 0U8HqMBwu4yYQlERjw98fay8fn/OrIRI2e6AVzOd+aPHNyyX0wLI6485dzK7Fs4dNqlP DRNngSaVj+Ao7r+5ZDnrUc2aQzxD1vWIJwhrfvssXyUjK12RUNHqBeTRc3Nd7IQdl8C/ HJuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MVYBsTvj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u206-20020a6279d7000000b006ba82adb9acsi5806226pfc.332.2023.10.22.20.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 20:31:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MVYBsTvj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id E531F805BCAB; Sun, 22 Oct 2023 20:31:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233339AbjJWDa5 (ORCPT + 26 others); Sun, 22 Oct 2023 23:30:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233353AbjJWDaY (ORCPT ); Sun, 22 Oct 2023 23:30:24 -0400 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A517C10D3; Sun, 22 Oct 2023 20:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698031815; x=1729567815; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KyMoHWShCcyV3MRbZKpVC/E1DYBRT6LqwzkBXptqrAo=; b=MVYBsTvjipWSPUfEAWKwEazuwuFGsD9t8K10AxLyA567jfWDB0D2+rnb 4qndguMndfcI8U+nOsc700nL0kRL+3tn4EUVpfYflNSMKzQVXij6Fhn0M cSjQbYCQCrRaovgoZi9bnOoKV+ZKjEyiFCL9xlRl9k9LU+kwl742LIjVe UVAK/oxeax8xlOdQ0FZ48jzOm/SJOERgHgIWpDqnF5TKGRUjz1YUIklJo n3hQxii/pOxwVbwpuOqBvZCPido/E1OgiFDropS5OIkdyVgA4YBLaZx8t xA7Bjsn+4vEmq3jSq+TXyzZgo8HqJ5eQRxMfuqJcYDm11g8zlm0v1WDcp A==; X-IronPort-AV: E=McAfee;i="6600,9927,10871"; a="5380110" X-IronPort-AV: E=Sophos;i="6.03,244,1694761200"; d="scan'208";a="5380110" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2023 20:30:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10871"; a="881617680" X-IronPort-AV: E=Sophos;i="6.03,244,1694761200"; d="scan'208";a="881617680" Received: from yilunxu-optiplex-7050.sh.intel.com ([10.239.159.165]) by orsmga004.jf.intel.com with ESMTP; 22 Oct 2023 20:30:13 -0700 From: Xu Yilun To: gregkh@linuxfoundation.org Cc: hao.wu@intel.com, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, yilun.xu@intel.com Subject: [RESEND PATCH 2/2] fpga: Fix memory leak for fpga_region_test_class_find() Date: Mon, 23 Oct 2023 11:28:57 +0800 Message-Id: <20231023032857.902699-3-yilun.xu@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231023032857.902699-1-yilun.xu@linux.intel.com> References: <20231023032857.902699-1-yilun.xu@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 22 Oct 2023 20:31:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780515462872383548 X-GMAIL-MSGID: 1780515462872383548 From: Jinjie Ruan fpga_region_class_find() in fpga_region_test_class_find() will call get_device() if the data is matched, which will increment refcount for dev->kobj, so it should call put_device() to decrement refcount for dev->kobj to free the region, because fpga_region_unregister() will call fpga_region_dev_release() only when the refcount for dev->kobj is zero but fpga_region_test_init() call device_register() in fpga_region_register_full(), which also increment refcount. So call put_device() after calling fpga_region_class_find() in fpga_region_test_class_find(). After applying this patch, the following memory leak is never detected. unreferenced object 0xffff88810c8ef000 (size 1024): comm "kunit_try_catch", pid 1875, jiffies 4294715298 (age 836.836s) hex dump (first 32 bytes): b8 d1 fb 05 81 88 ff ff 08 f0 8e 0c 81 88 ff ff ................ 08 f0 8e 0c 81 88 ff ff 00 00 00 00 00 00 00 00 ................ backtrace: [] kmalloc_trace+0x27/0xa0 [] fpga_region_register_full+0x51/0x430 [fpga_region] [] 0xffffffffa0228e47 [] kunit_try_run_case+0xdd/0x250 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b5/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 unreferenced object 0xffff888105fbd1b8 (size 8): comm "kunit_try_catch", pid 1875, jiffies 4294715298 (age 836.836s) hex dump (first 8 bytes): 72 65 67 69 6f 6e 30 00 region0. backtrace: [] __kmalloc_node_track_caller+0x53/0x150 [] kvasprintf+0xb0/0x130 [] kobject_set_name_vargs+0x41/0x110 [] dev_set_name+0xab/0xe0 [] fpga_region_register_full+0x312/0x430 [fpga_region] [] 0xffffffffa0228e47 [] kunit_try_run_case+0xdd/0x250 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b5/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 unreferenced object 0xffff88810b3b8a00 (size 256): comm "kunit_try_catch", pid 1875, jiffies 4294715298 (age 836.836s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 08 8a 3b 0b 81 88 ff ff ..........;..... 08 8a 3b 0b 81 88 ff ff e0 ac 04 83 ff ff ff ff ..;............. backtrace: [] kmalloc_trace+0x27/0xa0 [] device_add+0xa2a/0x15e0 [] fpga_region_register_full+0x321/0x430 [fpga_region] [] 0xffffffffa0228e47 [] kunit_try_run_case+0xdd/0x250 [] kunit_generic_run_threadfn_adapter+0x4a/0x90 [] kthread+0x2b5/0x380 [] ret_from_fork+0x2d/0x70 [] ret_from_fork_asm+0x11/0x20 Fixes: 64a5f972c93d ("fpga: add an initial KUnit suite for the FPGA Region") Signed-off-by: Jinjie Ruan Reviewed-by: Marco Pagani Acked-by: Xu Yilun Link: https://lore.kernel.org/r/20231007094321.3447084-1-ruanjinjie@huawei.com [yilun.xu@intel.com: slightly changes the commit message] Signed-off-by: Xu Yilun --- drivers/fpga/tests/fpga-region-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/fpga/tests/fpga-region-test.c b/drivers/fpga/tests/fpga-region-test.c index 9f9d50ee7871..baab07e3fc59 100644 --- a/drivers/fpga/tests/fpga-region-test.c +++ b/drivers/fpga/tests/fpga-region-test.c @@ -93,6 +93,8 @@ static void fpga_region_test_class_find(struct kunit *test) region = fpga_region_class_find(NULL, &ctx->region_pdev->dev, fake_region_match); KUNIT_EXPECT_PTR_EQ(test, region, ctx->region); + + put_device(®ion->dev); } /*