Linux IIO development
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: mranostay@gmail.com
Cc: linux-iio@vger.kernel.org
Subject: [bug report] iio: adc: ti-adc161s626: add regulator support
Date: Tue, 25 Oct 2016 22:06:16 +0300	[thread overview]
Message-ID: <20161025190616.GA30520@elgon.mountain> (raw)

Hello Matt Ranostay,

The patch 92f0afb5b2be: "iio: adc: ti-adc161s626: add regulator
support" from Sep 18, 2016, leads to the following static checker
warning:

	drivers/iio/adc/ti-adc161s626.c:237 ti_adc_probe()
	error: 'data->ref' dereferencing possible ERR_PTR()

drivers/iio/adc/ti-adc161s626.c
   214  
   215          data->ref = devm_regulator_get(&spi->dev, "vdda");
   216          if (!IS_ERR(data->ref)) {

I don't understand what's going on here.

   217                  ret = regulator_enable(data->ref);
   218                  if (ret < 0)
   219                          return ret;
   220          }
   221  
   222          ret = iio_triggered_buffer_setup(indio_dev, NULL,
   223                                           ti_adc_trigger_handler, NULL);
   224          if (ret)
   225                  goto error_regulator_disable;
   226  
   227          ret = iio_device_register(indio_dev);
   228          if (ret)
   229                  goto error_unreg_buffer;
   230  
   231          return 0;
   232  
   233  error_unreg_buffer:
   234          iio_triggered_buffer_cleanup(indio_dev);
   235  
   236  error_regulator_disable:
   237          regulator_disable(data->ref);

Static checker is correct.

   238  
   239          return ret;
   240  }

regards,
dan carpenter

             reply	other threads:[~2016-10-25 19:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 19:06 Dan Carpenter [this message]
2016-10-28  7:58 ` [bug report] iio: adc: ti-adc161s626: add regulator support Matt Ranostay
  -- strict thread matches above, loose matches on Subject: below --
2016-11-09 10:14 Dan Carpenter

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=20161025190616.GA30520@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=mranostay@gmail.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