linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()
@ 2020-06-03 11:56 Chuhong Yuan
  2020-06-03 14:30 ` kernel test robot
  2020-06-03 15:59 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Chuhong Yuan @ 2020-06-03 11:56 UTC (permalink / raw)
  Cc: Laurent Pinchart, Mauro Carvalho Chehab, Pallavi Kulkarni,
	Nayden Kanchev, Phil Carmody, RaniSuneela, linux-media,
	linux-kernel, Chuhong Yuan

preview_init_entities() does not call v4l2_ctrl_handler_free() when
it fails.
Add the missed function to fix it.

Fixes: de1135d44f4f ("[media] omap3isp: CCDC, preview engine and resizer]")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/media/platform/omap3isp/isppreview.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/omap3isp/isppreview.c b/drivers/media/platform/omap3isp/isppreview.c
index 4dbdf3180d10..38b93ec60536 100644
--- a/drivers/media/platform/omap3isp/isppreview.c
+++ b/drivers/media/platform/omap3isp/isppreview.c
@@ -2287,7 +2287,7 @@ static int preview_init_entities(struct isp_prev_device *prev)
 	me->ops = &preview_media_ops;
 	ret = media_entity_pads_init(me, PREV_PADS_NUM, pads);
 	if (ret < 0)
-		return ret;
+		goto err_handler_free;
 
 	preview_init_formats(sd, NULL);
 
@@ -2320,6 +2320,8 @@ static int preview_init_entities(struct isp_prev_device *prev)
 	omap3isp_video_cleanup(&prev->video_in);
 error_video_in:
 	media_entity_cleanup(&prev->subdev.entity);
+error_handler_free:
+	v4l2_ctrl_handler_free(&prev->ctrls);
 	return ret;
 }
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()
  2020-06-03 11:56 [PATCH] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities() Chuhong Yuan
@ 2020-06-03 14:30 ` kernel test robot
  2020-06-03 15:59 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-06-03 14:30 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: kbuild-all, Laurent Pinchart, Mauro Carvalho Chehab, linux-media,
	Pallavi Kulkarni, Nayden Kanchev, Phil Carmody, RaniSuneela,
	linux-kernel, Chuhong Yuan

[-- Attachment #1: Type: text/plain, Size: 4947 bytes --]

Hi Chuhong,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.7 next-20200603]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Chuhong-Yuan/media-omap3isp-Add-missed-v4l2_ctrl_handler_free-for-preview_init_entities/20200603-200044
base:   git://linuxtv.org/media_tree.git master
config: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

drivers/media/platform/omap3isp/isppreview.c: In function 'preview_init_entities':
drivers/media/platform/omap3isp/isppreview.c:2323:1: warning: label 'error_handler_free' defined but not used [-Wunused-label]
2323 | error_handler_free:
| ^~~~~~~~~~~~~~~~~~
>> drivers/media/platform/omap3isp/isppreview.c:2290:3: error: label 'err_handler_free' used but not defined
2290 |   goto err_handler_free;
|   ^~~~

vim +/err_handler_free +2290 drivers/media/platform/omap3isp/isppreview.c

  2247	
  2248	/* -----------------------------------------------------------------------------
  2249	 * ISP previewer initialisation and cleanup
  2250	 */
  2251	
  2252	/*
  2253	 * preview_init_entities - Initialize subdev and media entity.
  2254	 * @prev : Pointer to preview structure
  2255	 * return -ENOMEM or zero on success
  2256	 */
  2257	static int preview_init_entities(struct isp_prev_device *prev)
  2258	{
  2259		struct v4l2_subdev *sd = &prev->subdev;
  2260		struct media_pad *pads = prev->pads;
  2261		struct media_entity *me = &sd->entity;
  2262		int ret;
  2263	
  2264		prev->input = PREVIEW_INPUT_NONE;
  2265	
  2266		v4l2_subdev_init(sd, &preview_v4l2_ops);
  2267		sd->internal_ops = &preview_v4l2_internal_ops;
  2268		strscpy(sd->name, "OMAP3 ISP preview", sizeof(sd->name));
  2269		sd->grp_id = 1 << 16;	/* group ID for isp subdevs */
  2270		v4l2_set_subdevdata(sd, prev);
  2271		sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
  2272	
  2273		v4l2_ctrl_handler_init(&prev->ctrls, 2);
  2274		v4l2_ctrl_new_std(&prev->ctrls, &preview_ctrl_ops, V4L2_CID_BRIGHTNESS,
  2275				  ISPPRV_BRIGHT_LOW, ISPPRV_BRIGHT_HIGH,
  2276				  ISPPRV_BRIGHT_STEP, ISPPRV_BRIGHT_DEF);
  2277		v4l2_ctrl_new_std(&prev->ctrls, &preview_ctrl_ops, V4L2_CID_CONTRAST,
  2278				  ISPPRV_CONTRAST_LOW, ISPPRV_CONTRAST_HIGH,
  2279				  ISPPRV_CONTRAST_STEP, ISPPRV_CONTRAST_DEF);
  2280		v4l2_ctrl_handler_setup(&prev->ctrls);
  2281		sd->ctrl_handler = &prev->ctrls;
  2282	
  2283		pads[PREV_PAD_SINK].flags = MEDIA_PAD_FL_SINK
  2284					    | MEDIA_PAD_FL_MUST_CONNECT;
  2285		pads[PREV_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
  2286	
  2287		me->ops = &preview_media_ops;
  2288		ret = media_entity_pads_init(me, PREV_PADS_NUM, pads);
  2289		if (ret < 0)
> 2290			goto err_handler_free;
  2291	
  2292		preview_init_formats(sd, NULL);
  2293	
  2294		/* According to the OMAP34xx TRM, video buffers need to be aligned on a
  2295		 * 32 bytes boundary. However, an undocumented hardware bug requires a
  2296		 * 64 bytes boundary at the preview engine input.
  2297		 */
  2298		prev->video_in.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
  2299		prev->video_in.ops = &preview_video_ops;
  2300		prev->video_in.isp = to_isp_device(prev);
  2301		prev->video_in.capture_mem = PAGE_ALIGN(4096 * 4096) * 2 * 3;
  2302		prev->video_in.bpl_alignment = 64;
  2303		prev->video_out.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
  2304		prev->video_out.ops = &preview_video_ops;
  2305		prev->video_out.isp = to_isp_device(prev);
  2306		prev->video_out.capture_mem = PAGE_ALIGN(4096 * 4096) * 2 * 3;
  2307		prev->video_out.bpl_alignment = 32;
  2308	
  2309		ret = omap3isp_video_init(&prev->video_in, "preview");
  2310		if (ret < 0)
  2311			goto error_video_in;
  2312	
  2313		ret = omap3isp_video_init(&prev->video_out, "preview");
  2314		if (ret < 0)
  2315			goto error_video_out;
  2316	
  2317		return 0;
  2318	
  2319	error_video_out:
  2320		omap3isp_video_cleanup(&prev->video_in);
  2321	error_video_in:
  2322		media_entity_cleanup(&prev->subdev.entity);
  2323	error_handler_free:
  2324		v4l2_ctrl_handler_free(&prev->ctrls);
  2325		return ret;
  2326	}
  2327	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 63584 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()
  2020-06-03 11:56 [PATCH] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities() Chuhong Yuan
  2020-06-03 14:30 ` kernel test robot
@ 2020-06-03 15:59 ` kernel test robot
  1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-06-03 15:59 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: kbuild-all, clang-built-linux, Laurent Pinchart,
	Mauro Carvalho Chehab, linux-media, Pallavi Kulkarni,
	Nayden Kanchev, Phil Carmody, RaniSuneela, linux-kernel,
	Chuhong Yuan

[-- Attachment #1: Type: text/plain, Size: 5050 bytes --]

Hi Chuhong,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.7 next-20200603]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Chuhong-Yuan/media-omap3isp-Add-missed-v4l2_ctrl_handler_free-for-preview_init_entities/20200603-200044
base:   git://linuxtv.org/media_tree.git master
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 16437992cac249f6fe1efd392d20e3469b47e39e)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/media/platform/omap3isp/isppreview.c:2323:1: warning: unused label 'error_handler_free' [-Wunused-label]
error_handler_free:
^~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/omap3isp/isppreview.c:2290:8: error: use of undeclared label 'err_handler_free'
goto err_handler_free;
^
1 warning and 1 error generated.

vim +/err_handler_free +2290 drivers/media/platform/omap3isp/isppreview.c

  2247	
  2248	/* -----------------------------------------------------------------------------
  2249	 * ISP previewer initialisation and cleanup
  2250	 */
  2251	
  2252	/*
  2253	 * preview_init_entities - Initialize subdev and media entity.
  2254	 * @prev : Pointer to preview structure
  2255	 * return -ENOMEM or zero on success
  2256	 */
  2257	static int preview_init_entities(struct isp_prev_device *prev)
  2258	{
  2259		struct v4l2_subdev *sd = &prev->subdev;
  2260		struct media_pad *pads = prev->pads;
  2261		struct media_entity *me = &sd->entity;
  2262		int ret;
  2263	
  2264		prev->input = PREVIEW_INPUT_NONE;
  2265	
  2266		v4l2_subdev_init(sd, &preview_v4l2_ops);
  2267		sd->internal_ops = &preview_v4l2_internal_ops;
  2268		strscpy(sd->name, "OMAP3 ISP preview", sizeof(sd->name));
  2269		sd->grp_id = 1 << 16;	/* group ID for isp subdevs */
  2270		v4l2_set_subdevdata(sd, prev);
  2271		sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
  2272	
  2273		v4l2_ctrl_handler_init(&prev->ctrls, 2);
  2274		v4l2_ctrl_new_std(&prev->ctrls, &preview_ctrl_ops, V4L2_CID_BRIGHTNESS,
  2275				  ISPPRV_BRIGHT_LOW, ISPPRV_BRIGHT_HIGH,
  2276				  ISPPRV_BRIGHT_STEP, ISPPRV_BRIGHT_DEF);
  2277		v4l2_ctrl_new_std(&prev->ctrls, &preview_ctrl_ops, V4L2_CID_CONTRAST,
  2278				  ISPPRV_CONTRAST_LOW, ISPPRV_CONTRAST_HIGH,
  2279				  ISPPRV_CONTRAST_STEP, ISPPRV_CONTRAST_DEF);
  2280		v4l2_ctrl_handler_setup(&prev->ctrls);
  2281		sd->ctrl_handler = &prev->ctrls;
  2282	
  2283		pads[PREV_PAD_SINK].flags = MEDIA_PAD_FL_SINK
  2284					    | MEDIA_PAD_FL_MUST_CONNECT;
  2285		pads[PREV_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
  2286	
  2287		me->ops = &preview_media_ops;
  2288		ret = media_entity_pads_init(me, PREV_PADS_NUM, pads);
  2289		if (ret < 0)
> 2290			goto err_handler_free;
  2291	
  2292		preview_init_formats(sd, NULL);
  2293	
  2294		/* According to the OMAP34xx TRM, video buffers need to be aligned on a
  2295		 * 32 bytes boundary. However, an undocumented hardware bug requires a
  2296		 * 64 bytes boundary at the preview engine input.
  2297		 */
  2298		prev->video_in.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
  2299		prev->video_in.ops = &preview_video_ops;
  2300		prev->video_in.isp = to_isp_device(prev);
  2301		prev->video_in.capture_mem = PAGE_ALIGN(4096 * 4096) * 2 * 3;
  2302		prev->video_in.bpl_alignment = 64;
  2303		prev->video_out.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
  2304		prev->video_out.ops = &preview_video_ops;
  2305		prev->video_out.isp = to_isp_device(prev);
  2306		prev->video_out.capture_mem = PAGE_ALIGN(4096 * 4096) * 2 * 3;
  2307		prev->video_out.bpl_alignment = 32;
  2308	
  2309		ret = omap3isp_video_init(&prev->video_in, "preview");
  2310		if (ret < 0)
  2311			goto error_video_in;
  2312	
  2313		ret = omap3isp_video_init(&prev->video_out, "preview");
  2314		if (ret < 0)
  2315			goto error_video_out;
  2316	
  2317		return 0;
  2318	
  2319	error_video_out:
  2320		omap3isp_video_cleanup(&prev->video_in);
  2321	error_video_in:
  2322		media_entity_cleanup(&prev->subdev.entity);
> 2323	error_handler_free:
  2324		v4l2_ctrl_handler_free(&prev->ctrls);
  2325		return ret;
  2326	}
  2327	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 73663 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-03 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 11:56 [PATCH] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities() Chuhong Yuan
2020-06-03 14:30 ` kernel test robot
2020-06-03 15:59 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).