Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp228095lqb; Tue, 4 Jun 2024 09:33:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUne/dC7QtOhUBknKgdyuMKzK3uW1U3BKd5f508McIth19bp9yRYd/3zjWjkUVD28cas9vyAGZVABOJbOa0WwShK0eHswkgiLtg4ZseYQ== X-Google-Smtp-Source: AGHT+IGcHe5N4i3a0UQ1dYF5TNHn1aDFXCtiehVOkb28ssYOeki7Zf4GMO8a3PNoeMXBykrU9Kvf X-Received: by 2002:ac2:4843:0:b0:523:5dcc:c72 with SMTP id 2adb3069b0e04-52bab50a845mr32333e87.57.1717518828961; Tue, 04 Jun 2024 09:33:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717518828; cv=pass; d=google.com; s=arc-20160816; b=A6JlwbQf7FZdtIqTc/GTV6vP8czYIK4dBJjCIqimeHh3ltdtpuoOkwQCndNZHL2NpC qSUfnWWuXyQqOT5I8yUozcxZJUI5rd5iSn3T58gGroYomzkP9EyXn6eIzyXyJHCyOrlR zVhkNXwnI6nHYCBeSqrfG3PGbcBRlAIvOQc149hV86fPMcEqlCl69HnRNiluUInJ/6ww XrAfTGAvUbPQPkGC5x86Y/9wdkUiQ81s2O420Zyk49oupyZRofvrcDrSk6B/JBprPihN 2yodrNTOfHia2ocedYUtz5wyJCO3La0K1bOv1eChfMNlFQqm0+43M9APACuIkhROBrxk gqJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date; bh=MqGFG8Q8/ms2ucu7O+PAR4WYhmytQ9ssq2uiSAikaS4=; fh=uUEEoczOE3IA/2NcDQW/LO49sKI+M/G+dGtlsPlETSc=; b=GX2F22eM0vnP6FMGWsqa9mP34uOC0XwyldGduWD0Ucw+Nt17Mn6uJ1Ek9B1Jg6y+bw ByMG56dpHmnobz+dlVPXYkfH6PNF67pqcnLi+YcidR8sKgM8V6sQeBBm/6eMAK/iKpaM UnvLVTbVtg8uyKiI+I1Wo6lJRImT6UYklVCrpdHkkbTHavVitxvheKeWd7cF4QhDCEAd l/xV2RMdBoyehArB/ZeymK6SkrbLSt6PKeh/+c/f4Ua992Podt91zf1z5oRDb+577SWv 6YRcu7ZJF7gdEH61cvV69RSR+Vxjml7q4++gztqgT9Lxsdt7JA+7XvJSyb+PZd/ciCa1 Y1oA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a681656a6e0si504096966b.305.2024.06.04.09.33.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 09:33:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201081-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; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201081-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 am.mirrors.kernel.org (Postfix) with ESMTPS id A84211F21713 for ; Tue, 4 Jun 2024 16:33:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62E0D1487EA; Tue, 4 Jun 2024 16:33:39 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 8587A1EEE0; Tue, 4 Jun 2024 16:33:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717518818; cv=none; b=ffUn4mbT2uo+oO2ogz4PoBYqZpGY0WGg8fkb4Qc7Mbdc7fe0DBY6UY12uyj8pDTCQW975dHIXOkNGTWjs913XeHNM2lvoqL24wZ6foDo6uWsoUeEFN5TD4xMn82DJ/hDEhVjqCCWJ6bZhKxBO8EdAlYb71Udyf3vIXgrq8L7ID8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717518818; c=relaxed/simple; bh=kAzhAjn6QK5JsICYxRyX4n5pzxt+vb1SJWA2/ETD7r0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pAwRGZMgxKBL2lKJ5+J4Wx74uKz5ZezyGws0dzUwsiYowwOHSxnmYfDkW4RY+2D+2nrLkZVaJj2s5MEkAO8doUJ/t8ledfS2khbCbz+sMpP3+090VV6X7je+A9H6WcOvM2qu7WeYiCzctn7LHYhsD087lw1pBKTKFOiPbezkXgI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=fail smtp.mailfrom=kernel.org; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-CSE-ConnectionGUID: i3mNSQoqSiurHRMFTgXRJA== X-CSE-MsgGUID: F0MNUQgER1qPJFef7s43AQ== X-IronPort-AV: E=McAfee;i="6600,9927,11093"; a="13887589" X-IronPort-AV: E=Sophos;i="6.08,214,1712646000"; d="scan'208";a="13887589" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2024 09:33:37 -0700 X-CSE-ConnectionGUID: qvogQ/vhSEq74oPdDOHlFA== X-CSE-MsgGUID: eAvhOdHAQ+W9V6JKKT7IeA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,214,1712646000"; d="scan'208";a="37876183" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa008.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jun 2024 09:33:35 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1sEX6K-0000000DbcS-0kEx; Tue, 04 Jun 2024 19:33:32 +0300 Date: Tue, 4 Jun 2024 19:33:31 +0300 From: Andy Shevchenko To: Markus Elfring Cc: kernel-janitors@vger.kernel.org, Geert Uytterhoeven , Marek =?iso-8859-1?Q?Beh=FAn?= , Miguel Ojeda , Robin van der Gracht , LKML Subject: Re: [PATCH] auxdisplay: ht16k33: Drop device node reference after registration failure in ht16k33_led_probe() Message-ID: References: <0fc79fe9-da49-4cbe-a7ff-6443ad93f120@web.de> 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 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0fc79fe9-da49-4cbe-a7ff-6443ad93f120@web.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Tue, Jun 04, 2024 at 05:15:37PM +0200, Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 4 Jun 2024 17:02:15 +0200 > > A failed call of the function “devm_led_classdev_register_ext” > can be reported. > Add a call of the function “fwnode_handle_put” for this error case. Replace double quotes by parentheses, so the reference to the functions will look like func(). ... > err = devm_led_classdev_register_ext(dev, led, &init_data); > - if (err) > + if (err) { > dev_err(dev, "Failed to register LED\n"); > + fwnode_handle_put(init_data.fwnode); > + } There are two issues with this approach: 1) there is the same issue in ->remove(), isn't it? 2) it potentially might mess up the ordering if any other devm call happens in beetween. But, by design we don't use reference counting after we registered LED, hence both error and successful paths need to have this, so add another fwnode_handle_put() after this branch. -- With Best Regards, Andy Shevchenko