From mboxrd@z Thu Jan 1 00:00:00 1970 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 47F673ACEFB; Wed, 8 Apr 2026 18:26:05 +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=1775672765; cv=none; b=HQzvlAw1YcgO/YakcyM3E9CM97hKc/JWundMIzvxR+YNlzofLOfETrWdAZ+9uaqBMIlSesQZvK56/UqC9gAT7rYVxJjbnKzAK/zjpIP9y/68HVmCn1MbRGo8zSKFgJeUPjCuR2xB5ouv1CskV2VgxcP9J/l/iFeh/8Ivn1sagp8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775672765; c=relaxed/simple; bh=T6VDbJgyTrvwH+fWZsfQTNLMwv8ZV4xLjifJyJGmfyY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EJLqzaKciwf9cpmXPT0RjMnrd5z1o9AJIy9W9tsIYJeAxgE+sW2WU0CoyFkUNwPa0l3IRTsrwc7pS8mfFQ+ndJDALcf/YcHnHmexSAMBcGaqyBUpC4HreqcTen+kITAHdx4iL+EcRO/ChlHjwBFbY9M6bjzfAjk8+Cd9fiBOI6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TAIBMyjX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="TAIBMyjX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8C66C19421; Wed, 8 Apr 2026 18:26:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1775672765; bh=T6VDbJgyTrvwH+fWZsfQTNLMwv8ZV4xLjifJyJGmfyY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TAIBMyjXhD2U1u2e1HywsqLvwBa+LmPmnzPa9boj1sWzrnmRvR4/uJQKqlTEohFVz IfG09rUgkXANRyoLZQitQqYkvH65bq7dd20jvYf7KqCHdtyHnysLCOATvZCohaCe2O c24eZk8f02joi5KvaYdHPxEfHAD+fEgyRgN8uabc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Linus Walleij , Ethan Tidmore , Andy Shevchenko , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 6.6 101/160] iio: gyro: mpu3050: Fix irq resource leak Date: Wed, 8 Apr 2026 20:03:08 +0200 Message-ID: <20260408175916.955949393@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408175913.177092714@linuxfoundation.org> References: <20260408175913.177092714@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ethan Tidmore commit 4216db1043a3be72ef9c2b7b9f393d7fa72496e6 upstream. The interrupt handler is setup but only a few lines down if iio_trigger_register() fails the function returns without properly releasing the handler. Add cleanup goto to resolve resource leak. Detected by Smatch: drivers/iio/gyro/mpu3050-core.c:1128 mpu3050_trigger_probe() warn: 'irq' from request_threaded_irq() not released on lines: 1124. Fixes: 3904b28efb2c7 ("iio: gyro: Add driver for the MPU-3050 gyroscope") Reviewed-by: Linus Walleij Signed-off-by: Ethan Tidmore Reviewed-by: Andy Shevchenko Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/gyro/mpu3050-core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/iio/gyro/mpu3050-core.c +++ b/drivers/iio/gyro/mpu3050-core.c @@ -1139,11 +1139,16 @@ static int mpu3050_trigger_probe(struct ret = iio_trigger_register(mpu3050->trig); if (ret) - return ret; + goto err_iio_trigger; indio_dev->trig = iio_trigger_get(mpu3050->trig); return 0; + +err_iio_trigger: + free_irq(mpu3050->irq, mpu3050->trig); + + return ret; } int mpu3050_common_probe(struct device *dev,