All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: pinctrl: abx500: fix abx500_gpio_dbg_show_one() to show pull up/down
Date: Fri, 08 Nov 2013 10:06:50 +0000	[thread overview]
Message-ID: <20131108100650.GW27977@elgon.mountain> (raw)

Hello Patrice Chotard,

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

The patch d2752ae54d4a: "pinctrl: abx500: fix 
abx500_gpio_dbg_show_one() to show pull up/down" from May 24, 2013, 
leads to the following Smatch complaint:

drivers/pinctrl/pinctrl-abx500.c:624 abx500_gpio_dbg_show_one()
	 warn: variable dereferenced before check 'pctldev' (see line 574)

drivers/pinctrl/pinctrl-abx500.c
   573	{
   574		struct abx500_pinctrl *pct = pinctrl_dev_get_drvdata(pctldev);
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Patch introduces new unchecked dereference.

   575		const char *label = gpiochip_is_requested(chip, offset - 1);
   576		u8 gpio_offset = offset - 1;
   577		int mode = -1;
   578		bool is_out;
   579		bool pd;
   580		enum abx500_gpio_pull_updown pud = 0;
   581		int ret;
   582	

[snip]

   618	
   619				seq_printf(s, " %-9s", pull_up_down[pd]);
   620			}
   621		} else
   622			seq_printf(s, " %-9s", chip->get(chip, offset) ? "hi" : "lo");
   623	
   624		if (pctldev)
                    ^^^^^^^
Existing check is too late.

   625			mode = abx500_get_mode(pctldev, chip, offset);
   626	

regards,
dan carpenter

             reply	other threads:[~2013-11-08 10:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-08 10:06 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-07-31 10:54 pinctrl: abx500: fix abx500_gpio_dbg_show_one() to show pull up/down Dan Carpenter
2014-08-01  7:40 Patrice Chotard

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=20131108100650.GW27977@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.