lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4125a3a7bda2d099b59e32e20f733a92@208suo.com>
Date:   Tue, 18 Jul 2023 15:26:31 +0800
From:   sunran001@...suo.com
To:     davem@...emloft.net
Cc:     sparclinux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] sparc: kernel: add missing put_device()

The of_find_device_by_node() takes a reference to the underlying device
structure, we should release that reference.

Detected by coccinelle with the following ERRORS:
./arch/sparc/kernel/pci_psycho.c:308:2-8: ERROR: missing put_device;
call of_find_device_by_node on line 290, but without a corresponding
object release within this function.
./arch/sparc/kernel/pci_psycho.c:350:0-1: ERROR: missing put_device;
call of_find_device_by_node on line 290, but without a corresponding
object release within this function.

Signed-off-by: Ran Sun <sunran001@...suo.com>
---
  arch/sparc/kernel/pci_psycho.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/arch/sparc/kernel/pci_psycho.c 
b/arch/sparc/kernel/pci_psycho.c
index f413371da387..45f8370bbfad 100644
--- a/arch/sparc/kernel/pci_psycho.c
+++ b/arch/sparc/kernel/pci_psycho.c
@@ -305,6 +305,7 @@ static void psycho_register_error_handlers(struct 
pci_pbm_info *pbm)
       */

      if (op->archdata.num_irqs < 6)
+        put_device(op->dev);
          return;

      /* We really mean to ignore the return result here.  Two
@@ -347,6 +348,7 @@ static void psycho_register_error_handlers(struct 
pci_pbm_info *pbm)
          PSYCHO_PCICTRL_EEN);
      tmp &= ~(PSYCHO_PCICTRL_SBH_INT);
      upa_writeq(tmp, base + PSYCHO_PCIB_CTRL);
+    put_device(op->dev);
  }

  /* PSYCHO boot time probing and initialization. */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ