Re: [PATCH] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()

From: kernel test robot
Date: Wed Jun 03 2020 - 12:14:03 EST


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@xxxxxxxxx>

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@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip