Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5686ybf; Wed, 26 Feb 2020 07:51:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxHj3HGBOAxB7hDsr4LZUXi52ijkZDt9zDV1euR9I5v2D9kFj9PabCbsdc1Et8ZZ/mWfZsE X-Received: by 2002:aca:2315:: with SMTP id e21mr3622985oie.147.1582732267500; Wed, 26 Feb 2020 07:51:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582732267; cv=none; d=google.com; s=arc-20160816; b=ZzvDrZEXH6T4Rf1xeyGWvPZcVCzx7VJ10R0b8YBQKwHtcH5Y0RHbcAoDmVweTh1rSB 9n2R/5qNLxmEZ66mi5mwq+UUlKU5AiUr2nB8j9oyD8QkbTQGm/4ceCEuyh/RkJEJDYib hwCHZjzotR6FLVpTk/UumonbvSgTLdeeWoFzJASw3+Q/3qTk0Xn8yIkDjFrI5mWr82kR b3BeupwjSsMIPlNjlo0ehUAQHz9xax+EUJhDh/lLLRvxD/Ch2eZG2ZJqEb48bJOyYXck /eHSt4BE2y6Trt2/2FHW8AkHeqwflbZbU54DGSBbxw9ES6ZYI7fzvFrlJlL8FiJVFfGd cXNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cAa8/CP24OikfhF4/x02CUTgDQ3kXoOjpw86nd9bb+U=; b=uUhoGokDyj+p0Z2E1h7+tULPKC2kTO2NnAf1T9+aJdGD87sOB+AnSW2qJm+WgEI+P5 L+zPfPCFqfXkK/hrWqAuFfSox7856/zoXEvS/t4D7ZvqfAQ7brsjzqHi0H7ANw2jvt4N ZhGccnJOBpiufaknVjawRM/L54X6vF1K6Y7EoQ66l5Y0LWbhgXDAFSd0d5bnXPfE+3LQ nFiwF0wwgcLrKycgxQkBT33D8zsSeJt7N/b3Qx2uPMSwz1Fvot4qbMV/4AtpcJE5d+9r TD4jcgDaU24YQnXUdiYSpn5JjwwHpzUeobV8RtqgWE05ea/ADRp/THatH8zqXhsgcg9S 98Aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i7si1332283oib.63.2020.02.26.07.50.55; Wed, 26 Feb 2020 07:51:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728497AbgBZPtV (ORCPT + 99 others); Wed, 26 Feb 2020 10:49:21 -0500 Received: from retiisi.org.uk ([95.216.213.190]:46210 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728244AbgBZPtU (ORCPT ); Wed, 26 Feb 2020 10:49:20 -0500 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id 24F67634C87; Wed, 26 Feb 2020 17:48:07 +0200 (EET) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1j6yut-0002Ki-NW; Wed, 26 Feb 2020 17:48:07 +0200 Date: Wed, 26 Feb 2020 17:48:07 +0200 From: Sakari Ailus To: Eugen Hristev Cc: linux-media@vger.kernel.org, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] media: v4l2-core: fix entity initialization in device_register_subdev Message-ID: <20200226154807.GN5023@valkosipuli.retiisi.org.uk> References: <20200226152816.31557-1-eugen.hristev@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200226152816.31557-1-eugen.hristev@microchip.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 26, 2020 at 05:28:16PM +0200, Eugen Hristev wrote: > The entity variable was being initialized in the wrong place, before the > parameters have been checked. > To solve this, completely removed the entity variable and replaced it > with the initialization value : &sd->entity. > This will avoid dereferencing 'sd' pointer before it's being checked if > it's NULL. > > Fixes: 61f5db549dde ("[media] v4l: Make v4l2_subdev inherit from media_entity") > Signed-off-by: Eugen Hristev Thanks! Acked-by: Sakari Ailus -- Sakari Ailus