From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 783F0231835 for ; Fri, 24 Jul 2026 22:33:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784932436; cv=none; b=lECFgL1FC6KpV3fzs96jav0EBYPpG66gpcqGCSltumj5tT2oW+Jr9aqJzEIU5Y4DZ14HXXGrICFPrFpqOYhOJ9VpDv+AKEFiu9xqIqUclQmwe9qlBL2HTFzxE4JciJeMdbDrhWpQDmtw+Dvo4rkC8HWqQdN/Qq85i5YSbEJLqGQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784932436; c=relaxed/simple; bh=dP7nKuPuBJhotcoN9NwLo3xpovYwPjanldtFnpU4aOI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L3HtMfKjd3/G+7hmSt4fWxjWh550Cbc6NyCfdHjTZTKyZQxefmMDmhfdxwchsQngjSyNlHF+4Qc5Ph0H/S+ocF5NI98ETLcfCJwVTN6/cqWxqHCmt6LKA+BZSH6K7lpOR5h4SczD+gqYVeNA6/yXHU9DzF/nnM090RAE5313BVE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IlqaaxaG; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IlqaaxaG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AA0B1F00A3A; Fri, 24 Jul 2026 22:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1784932433; bh=s89KiDMZ01+E7QbCJC5Aj9GP2pBNaHlqeVh/1/9ICP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IlqaaxaGIpetTgenK8e8Ot2Cp8xlRrNtqg8EKylxgDSrdIX0b/PhZAmjYtddarZMN E5JeGRFdbrOgRKw120A0jQjksUtWsuy90WUtZDnDpxXKEp68ix/jlbOUZqR/9TMz5+ CqFdL76diDaJcjvB5EppxHB2WSW0qWACvlBGvn9jJyD6kGy89YEe4mKTESDWMSJYgV OF5nilgP6VIU7PZQH/M6CwFrLogU09MJXkYoallN10G+HBnXmYJXnJx7V9m0WKzFlq NXIulZZ4+FlMxS1bKTLG/t/63ImZ1TcfMwGqUihUSvQNWOOJ1BCDoo/u8jRYm2q2z2 5hlzUytZNtJRQ== From: srini@kernel.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Anandu Krishnan E , stable@kernel.org, Dmitry Baryshkov , Srinivas Kandagatla Subject: [PATCH 4/5] misc: fastrpc: fix channel ctx ref leak when session alloc fails Date: Fri, 24 Jul 2026 23:33:40 +0100 Message-ID: <20260724223342.629168-5-srini@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260724223342.629168-1-srini@kernel.org> References: <20260724223342.629168-1-srini@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Anandu Krishnan E fastrpc_channel_ctx_get() is called in fastrpc_device_open() before fastrpc_session_alloc(). If session alloc fails, the error path returns -EBUSY without calling fastrpc_channel_ctx_put(), leaking the reference. Fix by adding the missing put. Fixes: 278d56f970ae ("misc: fastrpc: Reference count channel context") Cc: stable@kernel.org Signed-off-by: Anandu Krishnan E Reviewed-by: Dmitry Baryshkov Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index c75eafe872cc..f8cbe30c5d5c 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1675,7 +1675,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp) dev_err(&cctx->rpdev->dev, "No session available\n"); mutex_destroy(&fl->mutex); kfree(fl); - + fastrpc_channel_ctx_put(cctx); return -EBUSY; } -- 2.53.0