History

irqchip/gic-v3: Fix error handling in gic_populate_ppi_partitions

of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. When kcalloc fails, it missing of_node_put() and results in refcount leak. Fix this by goto out_put_node label.

Miaoqian Lin committed 4 years ago

Commit ec8401a1 parent 3d456701 file · +1 −1Browse files

Unified · Split

drivers/irqchip/irq-gic-v3.c+1−1
@@ -1932,7 +1932,7 @@ static void __init gic_populate_ppi_partitions(struct device_node *gic_node) · 1931 unmodified lines
1932 1932
1933 gic_data.ppi_descs = kcalloc(gic_data.ppi_nr, sizeof(*gic_data.ppi_descs), GFP_KERNEL);1933 gic_data.ppi_descs = kcalloc(gic_data.ppi_nr, sizeof(*gic_data.ppi_descs), GFP_KERNEL);
1934 if (!gic_data.ppi_descs)1934 if (!gic_data.ppi_descs)
1935 return;1935 goto out_put_node;
1936 1936
1937 nr_parts = of_get_child_count(parts_node);1937 nr_parts = of_get_child_count(parts_node);
1938 1938

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t