Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 544EAC7EE23 for ; Tue, 30 May 2023 02:48:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbjE3Cr7 (ORCPT ); Mon, 29 May 2023 22:47:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbjE3Cr5 (ORCPT ); Mon, 29 May 2023 22:47:57 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83109109 for ; Mon, 29 May 2023 19:47:28 -0700 (PDT) Received: from pendragon.ideasonboard.com (om126158230151.30.openmobile.ne.jp [126.158.230.151]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 813A8E4; Tue, 30 May 2023 04:46:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1685414788; bh=NHFlr4lzig4t/GU95A4kucQyWsJfhI2P/jPP9q3ttaM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DfY1q4FmJtHfm/5Q+y2u/B7i5ZAjGJIMlPsv5l4XmvGEa+UoleMhKqizZVFwqffN1 VnaiuzZ+PJi6jrTl6YQXNZhbDDVAiyGHaxA8VxmUAUMCxHtQv8gbQY+YMHoghDazyd aYIxJ8Km1D8zFMUDedkLvJzaAqXdefYv84fx4Z0I= Date: Tue, 30 May 2023 05:46:50 +0300 From: Laurent Pinchart To: Sakari Ailus Cc: linux-media@vger.kernel.org, Philipp Zabel , hverkuil@xs4all.nl, Francesco Dolcini , aishwarya.kothari@toradex.com, Robert Foss , Todor Tomov , Hyun Kwon , bingbu.cao@intel.com, niklas.soderlund@ragnatech.se, Kieran Bingham , Benjamin Mugnier , Sylvain Petinot , Eugen Hristev , Nicolas Ferre , Maxime Ripard , Rui Miguel Silva , Fabio Estevam , Bryan O'Donoghue , Sylwester Nawrocki , Dafna Hirschfeld , Hugues Fruchet , Yong Deng , Paul Kocialkowski , "Lad, Prabhakar" , Benoit Parrot , Steve Longerbeam , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Marco Felsch Subject: Re: [RESEND PATCH v3 07/32] media: v4l: async: Drop unneeded list entry initialisation Message-ID: <20230530024650.GH21633@pendragon.ideasonboard.com> References: <20230525091615.2324824-1-sakari.ailus@linux.intel.com> <20230525091615.2324824-8-sakari.ailus@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230525091615.2324824-8-sakari.ailus@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi Sakari, Thank you for the patch. On Thu, May 25, 2023 at 12:15:50PM +0300, Sakari Ailus wrote: > The list entry is initialised as a head in v4l2_async_register_subdev() > just before being added to the list. This isn't needed, drop the > initialisation. Is this really unneeded ? Before the initialization and the list_add() call there are a few code paths that can access the async_list. For instance, the error path calls v4l2_async_cleanup(), which calls list_del_init(&sd->async_list); That won't work well on an uninitialized (or zero-initialized) list_head. > Signed-off-by: Sakari Ailus > --- > drivers/media/v4l2-core/v4l2-async.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c > index 320fe5cbaaf41..aef9a16e892ef 100644 > --- a/drivers/media/v4l2-core/v4l2-async.c > +++ b/drivers/media/v4l2-core/v4l2-async.c > @@ -823,8 +823,6 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd) > > mutex_lock(&list_lock); > > - INIT_LIST_HEAD(&sd->async_list); > - > list_for_each_entry(notifier, ¬ifier_list, list) { > struct v4l2_device *v4l2_dev = > v4l2_async_nf_find_v4l2_dev(notifier); -- Regards, Laurent Pinchart