Linux IIO development
 help / color / mirror / Atom feed
From: <Marius.Cristea@microchip.com>
To: <dan.carpenter@linaro.org>
Cc: <linux-iio@vger.kernel.org>
Subject: Re: [bug report] iio: adc: adding support for MCP3564 ADC
Date: Thu, 14 Sep 2023 13:19:33 +0000	[thread overview]
Message-ID: <2d35a8d374dfd68c9c85fab2ec552555b1343a09.camel@microchip.com> (raw)
In-Reply-To: <b936e5cf-fcd3-421b-917a-5673df02f631@kadam.mountain>

Hello Dan Carpenter,


  Thank you for your feedback.
Indeed, it will not add more information in this case so sure I can
remove that line.

Please, tell me how it is best to procced next: submitting another
PATCH (V6) in this case, or to create a Fixes to the PATCH_V5?

Best Regards,
Marius


On Thu, 2023-09-14 at 14:29 +0300, Dan Carpenter wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> On Thu, Sep 14, 2023 at 01:01:02PM +0300, Dan Carpenter wrote:
> > Hello Marius Cristea,
> > 
> > The patch 33ec3e5fc1ea: "iio: adc: adding support for MCP3564 ADC"
> > from Aug 29, 2023 (linux-next), leads to the following Smatch
> > static
> > checker warning:
> > 
> >       drivers/iio/adc/mcp3564.c:1426 mcp3564_probe()
> >       warn: address of NULL pointer 'indio_dev'
> > 
> > drivers/iio/adc/mcp3564.c
> >     1418 static int mcp3564_probe(struct spi_device *spi)
> >     1419 {
> >     1420         int ret;
> >     1421         struct iio_dev *indio_dev;
> >     1422         struct mcp3564_state *adc;
> >     1423
> >     1424         indio_dev = devm_iio_device_alloc(&spi->dev,
> > sizeof(*adc));
> >     1425         if (!indio_dev) {
> > --> 1426                 dev_err_probe(&indio_dev->dev,
> > PTR_ERR(indio_dev),
> >                                        ^^^^^^^^^^^^^^^
> > This will crash
> 
> Actually I think that dev_err_probe() has a check for this kind of
> bug
> so it doesn't actually crash.  The check is burried deep into the
> call
> tree where it prints the name and if the address is < PAGE_SIZE it
> just
> prints the device name as "(efault)".  But it's still not ideal.
> 
> regads,
> dan carpenter
> 


  reply	other threads:[~2023-09-14 13:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 10:01 [bug report] iio: adc: adding support for MCP3564 ADC Dan Carpenter
2023-09-14 11:29 ` Dan Carpenter
2023-09-14 13:19   ` Marius.Cristea [this message]
2023-09-14 13:29     ` Dan Carpenter
2023-09-15 15:40       ` Jonathan Cameron

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=2d35a8d374dfd68c9c85fab2ec552555b1343a09.camel@microchip.com \
    --to=marius.cristea@microchip.com \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-iio@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox