 remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev() · gregkh/linux@e4539eb · GitHub Skip to content Navigation Menu Toggle navigation Sign in Appearance settings Platform AI CODE CREATION GitHub Copilot Write better code with AI GitHub Spark Build and deploy intelligent apps GitHub Models Manage and compare prompts MCP Registry New Integrate external tools DEVELOPER WORKFLOWS Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes APPLICATION SECURITY GitHub Advanced Security Find and fix vulnerabilities Code security Secure your code as you build Secret protection  EXPLORE Why GitHub Documentation Blog Changelog Marketplace View all features Solutions BY COMPANY SIZE Enterprises Small and medium teams Startups Nonprofits BY USE CASE App Modernization DevSecOps DevOps CI/CD View all use cases BY INDUSTRY Healthcare Financial services Manufacturing Government View all industries View all solutions Resources EXPLORE BY TOPIC AI Software Development DevOps Security View all topics EXPLORE BY TYPE Customer stories Events &amp; webinars Ebooks &amp; reports Business insights GitHub Skills SUPPORT &amp; SERVICES Documentation Customer support Community forum Trust center Partners View all resources Open Source COMMUNITY GitHub Sponsors Fund open source developers PROGRAMS Security Lab Maintainer Community Accelerator GitHub Stars Archive Program REPOSITORIES Topics Trending Collections Enterprise ENTERPRISE SOLUTIONS Enterprise platform AI-powered developer platform AVAILABLE ADD-ONS GitHub Advanced Security Enterprise-grade security features Copilot for Business Enterprise-grade AI features Premium Support Enterprise-grade 24/7 support Pricing Search or jump to... Search code, repositories, users, issues, pull requests... --> Search Clear Search syntax tips Provide feedback --> We read every piece of feedback, and take your input very seriously.  Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly --> Name Query To see all available qualifiers, see our documentation . Cancel Create saved search Sign in Sign up Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} gregkh / linux Public Notifications You must be signed in to change notification settings Fork 676 Star 636 Code Actions Security and quality 0 Insights Additional navigation options Code Actions Security and quality Insights Commit e4539eb Browse files Browse files gscui authored and gregkh committed remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev() [ Upstream commit e01ce67 ] The kfree() should be called when of_irq_get_byname() fails or devm_request_threaded_irq() fails in qcom_add_sysmon_subdev(), otherwise there will be a memory leak, so add kfree() to fix it. Fixes: 027045a ("remoteproc: qcom: Add shutdown-ack irq") Signed-off-by: Gaosheng Cui &lt;cuigaosheng1@huawei.com&gt; Signed-off-by: Bjorn Andersson &lt;andersson@kernel.org&gt; Link: https://lore.kernel.org/r/20221129105650.1539187-1-cuigaosheng1@huawei.com Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt; 1 parent 6a65f46 commit e4539eb Copy full SHA for e4539eb 1 file changed + 4 - 1 Lines changed: 4 additions &amp; 1 deletion File tree Expand file tree Collapse file tree Open diff view settings Filter options drivers/remoteproc qcom_sysmon.c Expand file tree Collapse file tree Open diff view settings Collapse file ‎ drivers/remoteproc/qcom_sysmon.c ‎ Copy file name to clipboard Expand all lines: drivers/remoteproc/qcom_sysmon.c + 4 - 1 Lines changed: 4 additions &amp; 1 deletion Original file line number Diff line number Diff line change @@ -625,7 +625,9 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, 625 625 if ( sysmon -&gt; shutdown_irq != - ENODATA ) { 626 626 dev_err ( sysmon -&gt; dev , 627 627 &quot;failed to retrieve shutdown-ack IRQ\n&quot; ); 628 - return ERR_PTR ( sysmon -&gt; shutdown_irq ); 628 + ret = sysmon -&gt; shutdown_irq ; 629 + kfree ( sysmon ); 630 + return ERR_PTR ( ret ); 629 631 } 630 632 } else { 631 633 ret = devm_request_threaded_irq ( sysmon -&gt; dev , @@ -636,6 +638,7 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, 636 638 if ( ret ) { 637 639 dev_err ( sysmon -&gt; dev , 638 640 &quot;failed to acquire shutdown-ack IRQ\n&quot; ); 641 + kfree ( sysmon ); 639 642 return ERR_PTR ( ret ); 640 643 } 641 644 } 0 commit comments Comments 0 ( 0 ) Footer &copy; 2026 GitHub,&nbsp;Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. 