re: ARM: OMAP2+: Powerdomain: Remove the need to always have a voltdm associated to a pwrdm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Rajendra Nayak,

This is a semi-automatic email about new static checker warnings.

The patch cd8abed1da91: "ARM: OMAP2+: Powerdomain: Remove the need to 
always have a voltdm associated to a pwrdm" from Jun 17, 2013, leads 
to the following Smatch complaint:

arch/arm/mach-omap2/powerdomain.c:131 _pwrdm_register()
	 error: we previously assumed 'arch_pwrdm' could be null (see line 105)

arch/arm/mach-omap2/powerdomain.c
   104	
   105		if (arch_pwrdm && arch_pwrdm->pwrdm_has_voltdm)
                    ^^^^^^^^^^
Patch introduces new check.

   106			if (!arch_pwrdm->pwrdm_has_voltdm())
   107				goto skip_voltdm;
   108	
   109		voltdm = voltdm_lookup(pwrdm->voltdm.name);
   110		if (!voltdm) {
   111			pr_err("powerdomain: %s: voltagedomain %s does not exist\n",
   112			       pwrdm->name, pwrdm->voltdm.name);
   113			return -EINVAL;
   114		}
   115		pwrdm->voltdm.ptr = voltdm;
   116		INIT_LIST_HEAD(&pwrdm->voltdm_node);
   117		voltdm_add_pwrdm(voltdm, pwrdm);
   118	skip_voltdm:
   119		spin_lock_init(&pwrdm->_lock);
   120	
   121		list_add(&pwrdm->node, &pwrdm_list);
   122	
   123		/* Initialize the powerdomain's state counter */
   124		for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
   125			pwrdm->state_counter[i] = 0;
   126	
   127		pwrdm->ret_logic_off_counter = 0;
   128		for (i = 0; i < pwrdm->banks; i++)
   129			pwrdm->ret_mem_off_counter[i] = 0;
   130	
   131		arch_pwrdm->pwrdm_wait_transition(pwrdm);
                ^^^^^^^^^^^^
Existing unchecked dereference.

   132		pwrdm->state = pwrdm_read_pwrst(pwrdm);
   133		pwrdm->state_counter[pwrdm->state] = 1;

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux