Skip to content

Commit 94305e8

Browse files
committed
Merge tag 'pmdomain-v6.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm
Pull pmdomain fixes from Ulf Hansson: "Core: - Fix error checking in genpd_dev_pm_attach_by_id() Providers: - renesas: Remove obsolete nullify checks for rcar domains" * tag 'pmdomain-v6.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm: pmdomain: core: Fix error checking in genpd_dev_pm_attach_by_id() pmdomain: renesas: rcar: Remove obsolete nullify checks
2 parents a5b2c67 + 0f57576 commit 94305e8

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

drivers/pmdomain/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3126,7 +3126,7 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev,
31263126
/* Verify that the index is within a valid range. */
31273127
num_domains = of_count_phandle_with_args(dev->of_node, "power-domains",
31283128
"#power-domain-cells");
3129-
if (index >= num_domains)
3129+
if (num_domains < 0 || index >= num_domains)
31303130
return NULL;
31313131

31323132
/* Allocate and register device on the genpd bus. */

drivers/pmdomain/renesas/rcar-gen4-sysc.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,6 @@ static int __init rcar_gen4_sysc_pd_init(void)
338338
struct rcar_gen4_sysc_pd *pd;
339339
size_t n;
340340

341-
if (!area->name) {
342-
/* Skip NULLified area */
343-
continue;
344-
}
345-
346341
n = strlen(area->name) + 1;
347342
pd = kzalloc(sizeof(*pd) + n, GFP_KERNEL);
348343
if (!pd) {

drivers/pmdomain/renesas/rcar-sysc.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,6 @@ static int __init rcar_sysc_pd_init(void)
396396
struct rcar_sysc_pd *pd;
397397
size_t n;
398398

399-
if (!area->name) {
400-
/* Skip NULLified area */
401-
continue;
402-
}
403-
404399
n = strlen(area->name) + 1;
405400
pd = kzalloc(sizeof(*pd) + n, GFP_KERNEL);
406401
if (!pd) {

0 commit comments

Comments
 (0)