[linux-next:master 6872/10546] drivers/staging/media/atomisp/pci/atomisp_fops.c:532 atomisp_open() warn: missing unwind goto?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f7efed9f38f886edb450041b82a6f15d663c98f8
commit: 347f2e56b94e1ed197daa6697b22af049a82157d [6872/10546] media: atomisp: Simplify atomisp_open() and atomisp_release()
config: i386-randconfig-m021-20230618 (https://download.01.org/0day-ci/archive/20230618/202306180511.XWN0Hr7F-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230618/202306180511.XWN0Hr7F-lkp@xxxxxxxxx/reproduce)

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@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202306180511.XWN0Hr7F-lkp@xxxxxxxxx/

smatch warnings:
drivers/staging/media/atomisp/pci/atomisp_fops.c:532 atomisp_open() warn: missing unwind goto?

vim +532 drivers/staging/media/atomisp/pci/atomisp_fops.c

ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  502  static int atomisp_open(struct file *file)
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  503  {
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  504  	struct video_device *vdev = video_devdata(file);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  505  	struct atomisp_device *isp = video_get_drvdata(vdev);
af69562a28faa5 drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-08-28  506  	struct atomisp_video_pipe *pipe = atomisp_to_video_pipe(vdev);
af69562a28faa5 drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-08-28  507  	struct atomisp_sub_device *asd = pipe->asd;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  508  	int ret;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  509  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  510  	dev_dbg(isp->dev, "open device %s\n", vdev->name);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  511  
821e6f16125a0e drivers/staging/media/atomisp/pci/atomisp_fops.c          Mauro Carvalho Chehab 2021-11-05  512  	ret = v4l2_fh_open(file);
ba6856aab1a7ed drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-08-29  513  	if (ret)
821e6f16125a0e drivers/staging/media/atomisp/pci/atomisp_fops.c          Mauro Carvalho Chehab 2021-11-05  514  		return ret;
59a27d5c98f7f6 drivers/staging/media/atomisp/pci/atomisp_fops.c          Alan                  2017-11-06  515  
f10fc1790d5ecd drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-09-02  516  	mutex_lock(&isp->mutex);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  517  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  518  	asd->subdev.devnode = vdev;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  519  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  520  	if (!isp->input_cnt) {
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  521  		dev_err(isp->dev, "no camera attached\n");
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  522  		ret = -EINVAL;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  523  		goto error;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  524  	}
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  525  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  526  	/*
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  527  	 * atomisp does not allow multiple open
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  528  	 */
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  529  	if (pipe->users) {
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  530  		dev_dbg(isp->dev, "video node already opened\n");
f10fc1790d5ecd drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-09-02  531  		mutex_unlock(&isp->mutex);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19 @532  		return -EBUSY;

Do we need to undo the v4l2_fh_open()?

ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  533  	}
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  534  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  535  	/* runtime power management, turn on ISP */
deb9119f807abd drivers/staging/media/atomisp/pci/atomisp_fops.c          Mauro Carvalho Chehab 2021-04-23  536  	ret = pm_runtime_resume_and_get(vdev->v4l2_dev->dev);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  537  	if (ret < 0) {
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  538  		dev_err(isp->dev, "Failed to power on device\n");
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  539  		goto error;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  540  	}
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  541  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  542  	atomisp_dev_init_struct(isp);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  543  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  544  	ret = v4l2_subdev_call(isp->flash, core, s_power, 1);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  545  	if (ret < 0 && ret != -ENODEV && ret != -ENOIOCTLCMD) {
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  546  		dev_err(isp->dev, "Failed to power-on flash\n");
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  547  		goto css_error;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  548  	}
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  549  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  550  	atomisp_subdev_init_struct(asd);
60ec70a71a9f99 drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-12-28  551  	/* Ensure that a mode is set */
60ec70a71a9f99 drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-12-28  552  	v4l2_ctrl_s_ctrl(asd->run_mode, pipe->default_run_mode);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  553  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  554  	pipe->users++;
f10fc1790d5ecd drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-09-02  555  	mutex_unlock(&isp->mutex);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  556  	return 0;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  557  
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  558  css_error:
deb9119f807abd drivers/staging/media/atomisp/pci/atomisp_fops.c          Mauro Carvalho Chehab 2021-04-23  559  	pm_runtime_put(vdev->v4l2_dev->dev);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  560  error:
f10fc1790d5ecd drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-09-02  561  	mutex_unlock(&isp->mutex);
5b9853ad1329be drivers/staging/media/atomisp/pci/atomisp_fops.c          Hans de Goede         2022-08-29  562  	v4l2_fh_release(file);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  563  	return ret;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c Mauro Carvalho Chehab 2020-04-19  564  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux