mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aaro Koskinen <aaro.koskinen@nokia.com>
To: sameo@linux.intel.com, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script
Date: Wed, 14 Oct 2009 15:15:49 +0300	[thread overview]
Message-ID: <1255522550-15199-1-git-send-email-aaro.koskinen@nokia.com> (raw)

The script length cannot be negative. If the length is zero, return
an error.

The patch eliminates the following compiler warning:

drivers/mfd/twl4030-power.c: In function 'twl4030_power_init':
drivers/mfd/twl4030-power.c:151: warning: 'err' may be used uninitialized in this function
drivers/mfd/twl4030-power.c:151: note: 'err' was declared here

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 drivers/mfd/twl4030-power.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index d423e0c..eae6cda 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -146,9 +146,9 @@ out:
 }
 
 static int __init twl4030_write_script(u8 address, struct twl4030_ins *script,
-				       int len)
+				       unsigned len)
 {
-	int err;
+	int err = EINVAL;
 
 	for (; len; len--, address++, script++) {
 		if (len == 1) {
-- 
1.6.0.4


             reply	other threads:[~2009-10-14 12:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14 12:15 Aaro Koskinen [this message]
2009-10-14 12:15 ` [PATCH 2/2] mfd: twl4030-power: fix undefined resconfig value checks Aaro Koskinen
2009-10-19 16:37 ` [PATCH 1/2] mfd: twl4030-power: do not allow negative or zero length script Samuel Ortiz
2009-10-20 10:21   ` Aaro Koskinen

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=1255522550-15199-1-git-send-email-aaro.koskinen@nokia.com \
    --to=aaro.koskinen@nokia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.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

all inboxes | Powered by JetHome®