From nobody Sun Feb 8 04:11:47 2026 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 8F773228C99 for ; Mon, 7 Apr 2025 08:28:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744014497; cv=none; b=U8rX55MwBQrh10AjZbPE2yEPW15o/hGAmKAArghlrVaKtCLYj2VRyQV6/XEjyjsAfFC6TaEGXEj+8HtvYo7tTjcGY8cZioyDGPb0yrUJml6bQEfwJW6CXPD0UUaVJwQc6/GWHTaKxDlaajEYjYJl0TUbRYaohAUJ+Wat0Hzy8Ws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744014497; c=relaxed/simple; bh=EivRHSAtgDyY+dAxX5GqXBkcIwzYXhvrOY7AZsW0Uck=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TFqLZ3t5fBgasCRqGxbBWcqZA1oP928q+IabJwx3eFE6zjX8WpshrI7eDt68ZmxElbCB2VxvQ/9L6sSUXu1eQIKg6xbXtruEmzUD6wgC5NMgp1EN16mNNigIN+8H60SZbfFuI5xxlJbRttqpDAHPYVrx5xZkM5JOwcOj4SEWrd4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=jjN5FDYZ; arc=none smtp.client-ip=91.218.175.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="jjN5FDYZ" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1744014492; 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; bh=r+lrJOKr8j6gVtWJaXtQgJkZ15e6JlGdjN+41t4SPAE=; b=jjN5FDYZgohQN9YF2nK2xgPYkaryD5y6Uf6NJMpQ00/X0re5NkiZhxLcg2DNlXgpsyyKTt DscofJL5wV2lYOPcb9U7Gt7Ct7B6x0e7/Omlhh4z/97cIPcykVh6zpTnFrg6Yh/QovpHeq ehgIJRv8BnqOjib+RdRuKbXQz95ABhY= From: Thorsten Blum To: John Crispin , Sergio Paracuellos , Thomas Bogendoerfer Cc: Thorsten Blum , stable@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: ralink: Fix refcount leak in ill_acc_of_setup() Date: Mon, 7 Apr 2025 10:27:58 +0200 Message-ID: <20250407082759.742105-1-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The of_find_device_by_node() function increments the reference count of the embedded device, which should be released with put_device() when it is no longer needed. In ill_acc_of_setup(), put_device() is only called on error paths, but not on the success path. Fix this by calling put_device() before returning successfully. Compile-tested only. Cc: stable@vger.kernel.org Fixes: 5433acd81e873 ("MIPS: ralink: add illegal access driver") Signed-off-by: Thorsten Blum --- arch/mips/ralink/ill_acc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/ralink/ill_acc.c b/arch/mips/ralink/ill_acc.c index 25341b2319d0..6d1d829854b6 100644 --- a/arch/mips/ralink/ill_acc.c +++ b/arch/mips/ralink/ill_acc.c @@ -84,6 +84,7 @@ static int __init ill_acc_of_setup(void) rt_memc_w32(ILL_INT_STATUS, REG_ILL_ACC_TYPE); =20 dev_info(&pdev->dev, "irq registered\n"); + put_device(&pdev->dev); =20 return 0; } --=20 2.49.0