Message ID | 20200603115623.1428692-1-hslester96@gmail.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Sakari Ailus |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1jgRwp-00G9Vv-D1; Wed, 03 Jun 2020 11:52:43 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725971AbgFCL4e (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Wed, 3 Jun 2020 07:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbgFCL4d (ORCPT <rfc822;linux-media@vger.kernel.org>); Wed, 3 Jun 2020 07:56:33 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BCAAC08C5C0; Wed, 3 Jun 2020 04:56:33 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id o8so1596690pgm.7; Wed, 03 Jun 2020 04:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bHDcmRjNocazVkgdUDkx6Jpsy/JdQaJOhrSUM3bjraE=; b=iAWKQ6V+9v3z6K11H8Jbca7CaNsVUSl+WwmMra5KYSeeaJKNl7LumaaS9qUkbDTEEn WVtf9VOdRQR622e98UFsCo4/NprsRk5kISHdV2Tl3SGLFsNpNx1O/QwzFzsiAAaL7hxu RDUxRY63mUtEJhqYjI7vmLNLjMUK9fVZ4YGa3ai/PnOGCEy9P5PCgKuLrnMi6JANnKjl ItqAZSbl5L/LDs/+qLzEUdnOYrTGHS6JJgLVKi5ipVwfD5bUh5+VQUcXn2as7EXSOb5Z 6W2lZIpyY8VXecyq/h1c2yaQINJNU0dL9xJv7xTd1FjYIS0jXjkLbsmZLulj9rxPZaO2 5fvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bHDcmRjNocazVkgdUDkx6Jpsy/JdQaJOhrSUM3bjraE=; b=Lfa/D5zEaabMTzwENr+DeW5uIJZB9CS6yzMHt7VyuCHILluegM6CDpHuDhOCyWBwLi DnOEdxfToxXu+imP+QHoF00eQYNp5/d/m1E8qlJy7v9Y2Suk7U9jc+rfc8A4Fe/sBwC1 1OcenOxY6hrlBdDYqb2zQ4hYiHwsPPlzbeKxriEjNI2uT7dip+kvfNFJoi6cxyxl4w1c VX/y4RtwdrpYSoGWVAQbKVtXbI/etmVa+Xfy9RuIYzX7PtCP7hC/NBosYUUNZyhdH2Vv hyHCVvnfYsBdL4uqPXTGDBdhm2/kVumCoVHySZQlhpNftNV8/sC4FKwONMLeoY9xNDyI sooQ== X-Gm-Message-State: AOAM530UqiQP5frFe4H9j/Tr1OVHpwME5bXpYNBj0syTnG+mtljX2noO JA6JjBiQpZvE2+oot4+nHJs= X-Google-Smtp-Source: ABdhPJzNry235yZPE1DFOyv33hlDDzApQ1EYFoD4Mu7aWqPRuqnXyqYCZs1dqBxeZP/yVLeVk1axgg== X-Received: by 2002:a17:90a:dd42:: with SMTP id u2mr5421952pjv.65.1591185392770; Wed, 03 Jun 2020 04:56:32 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.gmail.com with ESMTPSA id j186sm1786461pfb.220.2020.06.03.04.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2020 04:56:32 -0700 (PDT) From: Chuhong Yuan <hslester96@gmail.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Pallavi Kulkarni <p-kulkarni@ti.com>, Nayden Kanchev <nkanchev@mm-sol.com>, Phil Carmody <ext-phil.2.carmody@nokia.com>, RaniSuneela <r-m@ti.com>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan <hslester96@gmail.com> Subject: [PATCH] media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities() Date: Wed, 3 Jun 2020 19:56:23 +0800 Message-Id: <20200603115623.1428692-1-hslester96@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -0.8 (/) X-LSpam-Report: No, score=-0.8 required=5.0 tests=BAYES_00=-1.9,DKIM_ADSP_CUSTOM_MED=0.001,DKIM_SIGNED=0.1,FREEMAIL_FORGED_FROMDOMAIN=0.001,FREEMAIL_FROM=0.001,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_SORBS_WEB=1.5,T_DKIM_INVALID=0.01 autolearn=no autolearn_force=no |
Series |
media: omap3isp: Add missed v4l2_ctrl_handler_free() for preview_init_entities()
|
|
Commit Message
Chuhong Yuan
June 3, 2020, 11:56 a.m. UTC
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(-)
Comments
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
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
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; }