From: Dan Carpenter <dan.carpenter@oracle.com>
To: rnayak@ti.com
Cc: linux-omap@vger.kernel.org
Subject: re: ARM: OMAP2+: Powerdomain: Remove the need to always have a voltdm associated to a pwrdm
Date: Wed, 6 Nov 2013 23:36:12 +0300 [thread overview]
Message-ID: <20131106203612.GC22627@elgon.mountain> (raw)
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
reply other threads:[~2013-11-06 20:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131106203612.GC22627@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=linux-omap@vger.kernel.org \
--cc=rnayak@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox