Ma Ke
a8de554774
of: unittest: Fix device reference count leak in of_unittest_pci_node_verify
...
In of_unittest_pci_node_verify(), when the add parameter is false,
device_find_any_child() obtains a reference to a child device. This
function implicitly calls get_device() to increment the device's
reference count before returning the pointer. However, the caller
fails to properly release this reference by calling put_device(),
leading to a device reference count leak. Add put_device() in the else
branch immediately after child_dev is no longer needed.
As the comment of device_find_any_child states: "NOTE: you will need
to drop the reference with put_device() after use".
Found by code review.
Cc: stable@vger.kernel.org
Fixes: 26409dd045 ("of: unittest: Add pci_dt_testdrv pci driver")
Signed-off-by: Ma Ke <make24@iscas.ac.cn >
Signed-off-by: Rob Herring (Arm) <robh@kernel.org >
2025-10-01 09:33:23 -05:00
..
2025-07-30 19:26:49 -07:00
2025-07-31 14:57:54 -07:00
2025-07-29 09:52:01 -07:00
2025-08-01 08:43:11 +09:00
2025-08-09 08:40:28 +03:00
2025-08-07 10:07:06 +02:00
2025-08-09 08:47:28 +03:00
2025-07-23 10:34:30 -04:00
2025-07-29 11:13:27 -07:00
2025-07-22 19:10:17 -06:00
2025-08-07 07:38:25 +03:00
2025-07-31 13:36:27 -07:00
2025-07-29 14:02:53 -07:00
2025-07-29 09:52:01 -07:00
2025-08-03 13:49:10 -07:00
2025-07-29 11:42:31 -07:00
2025-07-31 09:45:28 -07:00
2025-08-03 16:23:09 -07:00
2025-08-01 12:35:12 -07:00
2025-07-30 19:26:49 -07:00
2025-08-04 17:22:55 -07:00
2025-07-29 16:30:38 -07:00
2025-08-09 18:10:01 +03:00
2025-07-29 12:15:39 -07:00
2025-08-07 10:07:06 +02:00
2025-08-09 08:15:43 +03:00
2025-08-07 10:07:06 +02:00
2025-07-30 17:14:01 -07:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-07-31 02:25:17 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 07:36:23 +03:00
2025-08-07 10:07:06 +02:00
2025-07-29 09:52:01 -07:00
2025-08-01 13:59:07 -07:00
2025-09-03 09:01:26 -05:00
2025-08-07 10:07:06 +02:00
2025-08-07 23:49:56 -05:00
2025-08-09 08:47:28 +03:00
2025-08-07 10:07:06 +02:00
2025-07-22 22:47:00 +02:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-07-29 12:05:38 -07:00
2025-07-31 13:43:02 -07:00
2025-07-28 17:16:12 -07:00
2025-08-09 08:15:43 +03:00
2025-07-31 14:57:54 -07:00
2025-08-07 06:27:58 -06:00
2025-07-29 12:15:39 -07:00
2025-10-01 09:33:23 -05:00
2025-07-23 11:52:48 +02:00
2025-09-03 09:01:26 -05:00
2025-08-01 12:31:50 -07:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-07-23 12:12:16 +02:00
2025-07-31 21:39:01 -07:00
2025-07-28 23:21:28 -07:00
2025-07-30 08:58:55 -07:00
2025-08-07 10:07:06 +02:00
2025-08-09 08:41:53 +03:00
2025-08-01 15:02:25 -07:00
2025-07-31 13:36:27 -07:00
2025-08-01 15:02:25 -07:00
2025-08-03 20:17:34 -07:00
2025-08-08 06:56:55 +03:00
2025-08-06 15:44:25 +03:00
2025-08-07 10:07:06 +02:00
2025-08-01 11:09:27 -07:00
2025-08-09 08:43:24 +03:00
2025-08-07 10:07:06 +02:00
2025-08-07 10:07:06 +02:00
2025-08-06 15:44:25 +03:00
2025-07-29 12:15:39 -07:00
2025-07-21 16:33:43 +02:00
2025-08-07 10:07:06 +02:00
2025-08-06 15:44:25 +03:00
2025-08-07 10:07:06 +02:00
2025-08-01 09:11:08 -04:00
2025-08-07 07:32:50 +03:00
2025-08-05 05:57:40 -04:00
2025-08-09 08:15:43 +03:00
2025-07-29 17:18:46 -07:00
2025-08-01 14:17:48 -07:00
2025-07-28 12:07:08 +02:00
2025-07-30 19:26:49 -07:00