All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Dan Carpenter <error27@gmail.com>
Cc: oe-kbuild@lists.linux.dev, Salah Triki <salah.triki@gmail.com>,
	lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	linux-iio@vger.kernel.org
Subject: Re: [jic23-iio:fixes-togreg 31/32] drivers/iio/potentiostat/lmp91000.c:353 lmp91000_probe() warn: missing unwind goto?
Date: Wed, 13 May 2026 10:48:39 +0100	[thread overview]
Message-ID: <20260513104839.72b5a06c@jic23-huawei> (raw)
In-Reply-To: <202605130437.SgMZ43gQ-lkp@intel.com>

On Wed, 13 May 2026 10:02:40 +0300
Dan Carpenter <error27@gmail.com> wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git fixes-togreg
> head:   2ec11ebb4d0dea4aa9604f8336cd1e1c390d5dcb
> commit: 82764dcb3643c70649f14fe8e92e667955574a8c [31/32] iio: potentiostat: lmp91000: fix probe order and cleanup paths
> config: i386-randconfig-141-20260512 (https://download.01.org/0day-ci/archive/20260513/202605130437.SgMZ43gQ-lkp@intel.com/config)
> compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
> smatch: v0.5.0-9065-ge9cc34fd
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <error27@gmail.com>
> | Closes: https://lore.kernel.org/r/202605130437.SgMZ43gQ-lkp@intel.com/
> 
> smatch warnings:
> drivers/iio/potentiostat/lmp91000.c:353 lmp91000_probe() warn: missing unwind goto?
Dropped for now.  Salah can you take another look at this please.

Thanks,

Jonathan

> 
> vim +353 drivers/iio/potentiostat/lmp91000.c
> 
> 7d8b3e100abeeff Uwe Kleine-König 2022-11-18  295  static int lmp91000_probe(struct i2c_client *client)
> 67e17300dc1d760 Matt Ranostay    2016-09-24  296  {
> 67e17300dc1d760 Matt Ranostay    2016-09-24  297  	struct device *dev = &client->dev;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  298  	struct lmp91000_data *data;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  299  	struct iio_dev *indio_dev;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  300  	int ret;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  301  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  302  	indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
> 67e17300dc1d760 Matt Ranostay    2016-09-24  303  	if (!indio_dev)
> 67e17300dc1d760 Matt Ranostay    2016-09-24  304  		return -ENOMEM;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  305  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  306  	indio_dev->info = &lmp91000_info;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  307  	indio_dev->channels = lmp91000_channels;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  308  	indio_dev->num_channels = ARRAY_SIZE(lmp91000_channels);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  309  	indio_dev->name = LMP91000_DRV_NAME;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  310  	indio_dev->modes = INDIO_DIRECT_MODE;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  311  	i2c_set_clientdata(client, indio_dev);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  312  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  313  	data = iio_priv(indio_dev);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  314  	data->dev = dev;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  315  	data->regmap = devm_regmap_init_i2c(client, &lmp91000_regmap_config);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  316  	if (IS_ERR(data->regmap)) {
> 67e17300dc1d760 Matt Ranostay    2016-09-24  317  		dev_err(dev, "regmap initialization failed.\n");
> 67e17300dc1d760 Matt Ranostay    2016-09-24  318  		return PTR_ERR(data->regmap);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  319  	}
> 67e17300dc1d760 Matt Ranostay    2016-09-24  320  
> 4d031666560da23 Gwendal Grignou  2021-03-09  321  	data->trig = devm_iio_trigger_alloc(dev, "%s-mux%d",
> 15ea2878bfb2550 Jonathan Cameron 2021-04-26  322  					    indio_dev->name,
> 15ea2878bfb2550 Jonathan Cameron 2021-04-26  323  					    iio_device_id(indio_dev));
> 368e8718875f17a Dixit Parmar     2025-08-22  324  	if (!data->trig)
> 67e17300dc1d760 Matt Ranostay    2016-09-24  325  		return -ENOMEM;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  326  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  327  	init_completion(&data->completion);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  328  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  329  	ret = lmp91000_read_config(data);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  330  	if (ret)
> 67e17300dc1d760 Matt Ranostay    2016-09-24  331  		return ret;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  332  
> 82764dcb3643c70 Salah Triki      2026-05-07  333  	data->cb_buffer = iio_channel_get_all_cb(dev, &lmp91000_buffer_cb, indio_dev);
> 82764dcb3643c70 Salah Triki      2026-05-07  334  	if (IS_ERR(data->cb_buffer)) {
> 82764dcb3643c70 Salah Triki      2026-05-07  335  		if (PTR_ERR(data->cb_buffer) == -ENODEV)
> 82764dcb3643c70 Salah Triki      2026-05-07  336  			ret = -EPROBE_DEFER;
> 82764dcb3643c70 Salah Triki      2026-05-07  337  		else
> 82764dcb3643c70 Salah Triki      2026-05-07  338  			ret = PTR_ERR(data->cb_buffer);
> 82764dcb3643c70 Salah Triki      2026-05-07  339  
> 82764dcb3643c70 Salah Triki      2026-05-07  340  		goto error_unreg_buffer;
> 82764dcb3643c70 Salah Triki      2026-05-07  341  	}
> 82764dcb3643c70 Salah Triki      2026-05-07  342  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  343  	ret = iio_trigger_set_immutable(iio_channel_cb_get_iio_dev(data->cb_buffer),
> 67e17300dc1d760 Matt Ranostay    2016-09-24  344  					data->trig);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  345  	if (ret) {
> 67e17300dc1d760 Matt Ranostay    2016-09-24  346  		dev_err(dev, "cannot set immutable trigger.\n");
> 67e17300dc1d760 Matt Ranostay    2016-09-24  347  		return ret;
> 
> Need to goto cleanup before returning
> 
> 67e17300dc1d760 Matt Ranostay    2016-09-24  348  	}
> 67e17300dc1d760 Matt Ranostay    2016-09-24  349  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  350  	ret = iio_trigger_register(data->trig);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  351  	if (ret) {
> 67e17300dc1d760 Matt Ranostay    2016-09-24  352  		dev_err(dev, "cannot register iio trigger.\n");
> 67e17300dc1d760 Matt Ranostay    2016-09-24 @353  		return ret;
> 
> Same.
> 
> 67e17300dc1d760 Matt Ranostay    2016-09-24  354  	}
> 67e17300dc1d760 Matt Ranostay    2016-09-24  355  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  356  	ret = iio_triggered_buffer_setup(indio_dev, NULL,
> 67e17300dc1d760 Matt Ranostay    2016-09-24  357  					 &lmp91000_buffer_handler,
> 67e17300dc1d760 Matt Ranostay    2016-09-24  358  					 &lmp91000_buffer_setup_ops);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  359  	if (ret)
> 67e17300dc1d760 Matt Ranostay    2016-09-24  360  		goto error_unreg_trigger;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  361  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  362  	data->adc_chan = iio_channel_cb_get_channels(data->cb_buffer);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  363  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  364  	ret = iio_device_register(indio_dev);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  365  	if (ret)
> 67e17300dc1d760 Matt Ranostay    2016-09-24  366  		goto error_unreg_cb_buffer;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  367  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  368  	return 0;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  369  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  370  error_unreg_cb_buffer:
> 67e17300dc1d760 Matt Ranostay    2016-09-24  371  	iio_channel_release_all_cb(data->cb_buffer);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  372  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  373  error_unreg_trigger:
> 67e17300dc1d760 Matt Ranostay    2016-09-24  374  	iio_trigger_unregister(data->trig);
> 67e17300dc1d760 Matt Ranostay    2016-09-24  375  
> 82764dcb3643c70 Salah Triki      2026-05-07  376  error_unreg_buffer:
> 82764dcb3643c70 Salah Triki      2026-05-07  377  	iio_triggered_buffer_cleanup(indio_dev);
> 82764dcb3643c70 Salah Triki      2026-05-07  378  
> 67e17300dc1d760 Matt Ranostay    2016-09-24  379  	return ret;
> 67e17300dc1d760 Matt Ranostay    2016-09-24  380  }
> 


      reply	other threads:[~2026-05-13  9:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 20:35 [jic23-iio:fixes-togreg 31/32] drivers/iio/potentiostat/lmp91000.c:353 lmp91000_probe() warn: missing unwind goto? kernel test robot
2026-05-13  7:02 ` Dan Carpenter
2026-05-13  9:48 ` Jonathan Cameron [this message]

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=20260513104839.72b5a06c@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=error27@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=salah.triki@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 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.