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 EABAF280CFB; Mon, 13 Apr 2026 16:37:59 +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=1776098280; cv=none; b=cZBG8EZQsf2wCU7dvibvrbkii3MOr97bqvrwzrXex3gWkIpOM0SMeoRO1AIYBi/b1sjzyGSJEUZ+AwArrbfZJwsokihOR/zXZBKMKEmmI6342Z20KQp3b0RpHgqna+ohZFbrUYiJzim5zkg6ojcBtayAYiYFgj1fWhxdzf4HEkM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098280; c=relaxed/simple; bh=jDdhs2qfFpl+0QNtnqtKWM9E4jy3VuJU2GNIEQU/k2I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Udyh+Y6idsjeSSH0Ck0PGSfv1VSAAlSXb1rnbqYDPdfnjRpFs2YP+ViUFTnN22gCwYEVEp97UQQj5DPWEJY9KfDCT9fSUITgm/mm/SJtJgR6kH58DgpqBGeigSNvudi0eYfQFwcgRgf+LCuqpWJlYhcmo7doQSqTB19lWfsXxpg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=anhFPxjy; 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="anhFPxjy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 812ECC2BCAF; Mon, 13 Apr 2026 16:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776098279; bh=jDdhs2qfFpl+0QNtnqtKWM9E4jy3VuJU2GNIEQU/k2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=anhFPxjyzF28mQYmALzQG6s890WhtPUunJvpVUSr3pUCbqx4/HJnY1K0xQadwtmgH RtZtSvjFyck5aB2dTolHEStVmbFwc+j4BqemiRMBnmSHVu3E8aT33y2tt88Da5fTcx PG9FlFwkjAo6gBpJ/rYhshFXnmsPZuHiGb6IwuOU= 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 5.15 463/570] iio: gyro: mpu3050: Fix irq resource leak Date: Mon, 13 Apr 2026 17:59:54 +0200 Message-ID: <20260413155847.814020168@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155830.386096114@linuxfoundation.org> References: <20260413155830.386096114@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-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 @@ -1141,11 +1141,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,