 remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev() · gregkh/linux@e01ce67 · 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 e01ce67 Browse files Browse files gscui authored and andersson committed remoteproc: sysmon: fix memory leak in qcom_add_sysmon_subdev() 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 1 parent 7bd156c commit e01ce67 Copy full SHA for e01ce67 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 @@ -652,7 +652,9 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, 652 652 if ( sysmon -&gt; shutdown_irq != - ENODATA ) { 653 653 dev_err ( sysmon -&gt; dev , 654 654 &quot;failed to retrieve shutdown-ack IRQ\n&quot; ); 655 - return ERR_PTR ( sysmon -&gt; shutdown_irq ); 655 + ret = sysmon -&gt; shutdown_irq ; 656 + kfree ( sysmon ); 657 + return ERR_PTR ( ret ); 656 658 } 657 659 } else { 658 660 ret = devm_request_threaded_irq ( sysmon -&gt; dev , @@ -663,6 +665,7 @@ struct qcom_sysmon *qcom_add_sysmon_subdev(struct rproc *rproc, 663 665 if ( ret ) { 664 666 dev_err ( sysmon -&gt; dev , 665 667 &quot;failed to acquire shutdown-ack IRQ\n&quot; ); 668 + kfree ( sysmon ); 666 669 return ERR_PTR ( ret ); 667 670 } 668 671 } 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. 