summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorWentao Liang <vulab@iscas.ac.cn>2026-05-26 10:21:24 +0000
committerJens Axboe <axboe@kernel.dk>2026-05-26 09:52:20 -0600
commit148cd4873115feb266c002d4d4618ea7f14342d9 (patch)
tree5c260a53435725748b516fa98378906b9aeb3208 /include/linux
parent23130b3ffcdb1568a9ef178ab3cba866e5486082 (diff)
block: partitions: fix of_node refcount leak in of_partition()
of_partition() calls of_node_get() on the parent device node at the beginning of the function, storing the reference in 'partitions_np'. This reference is leaked in two paths: 1. The compatibility check at the top of the function returns 0 without releasing partitions_np when the node exists but is not "fixed-partitions" compatible. 2. The function returns 1 at the end after successfully processing all partitions without releasing partitions_np. Fix both leaks by adding of_node_put(partitions_np) on each path. Fixes: 2e3a191e89f9 ("block: add support for partition table defined in OF") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Reviewed-by: Md Haris Iqbal <haris.iqbal@linux.dev> Link: https://patch.msgid.link/20260526102124.2283846-1-vulab@iscas.ac.cn Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions