Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2494083imu; Fri, 23 Nov 2018 10:00:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vi4DsE4di46hHalvfCRQbx/XXt3X6PXTL8YR3/V6tDc0zGsVxG2isoglGRKXyVXcHfEH2g X-Received: by 2002:a63:f959:: with SMTP id q25mr15155943pgk.315.1542996039895; Fri, 23 Nov 2018 10:00:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542996039; cv=none; d=google.com; s=arc-20160816; b=eax9CIJ3XpfYZxSsEXkm+RkTiuH9NWN6bmdabjP7JkMOPrvWbqPHm7MPRQaJTFvdTt JFAhn7/duFkWIk3Rt6BxSG0gIXO5BZTLOLSCLlBGwHYcgyX7Szn1cmUwO6Mg+YaNJbNh Agwe/RwTVq4SRcwmT/CLx+QpbA/m8w0jbA140zgafToYanM43TztII5rPeoyKyQ1soJi haGm9ErnPKbPfsfb2T+TW1ubqwQWeb9HS0LAtQsqOVWigzvb8UCKG6uPdg2NBKidceuC dH+ml0P2m7N0vjNu9pC13iJ61L4qh+Xy933gy+AZVnDkPPgnrIwuZw6VYwyju/DLijG+ MQ+A== 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=4WFYb8w6Kobv5fiVy7huWANuti1ZICZz2D44GE0WPHk=; b=doJQerh5Xv9LpDOQ/7wk/LjEfIF7RuyxYn/oySF9N5AYHrLCwHyxO13QZPsjIWK9n5 eX1lwSQkFymAGvRK7LBZc4N8f2bkywkgyX45Yq02fppQQ9q6Fqag27PuVN+1iFqcGL0r MdhCGEjA2G0MZAs1jhq6SRr96gmQxMsmF41/OE9RpaX+VAL9dOY4yDzu9/EhyuTjYvu4 GbyPrlDXY0R19ha6gV6eN+B1Dxf3Y51e0jzefA7eVnmihGFwzcfv4phPFPdQU9z03mwt 3zxOOGkwGfCkN+QF5NtG0ArobYAVVSnvtgPxOt/byuiMsZjMBcr9MFi/pLuoBzIWthcI FyTQ== 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 m1si14078118pgi.218.2018.11.23.10.00.21; Fri, 23 Nov 2018 10:00:39 -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 S2395140AbeKWAid (ORCPT + 99 others); Thu, 22 Nov 2018 19:38:33 -0500 Received: from mail.bootlin.com ([62.4.15.54]:56876 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388851AbeKWAid (ORCPT ); Thu, 22 Nov 2018 19:38:33 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 5649E207A8; Thu, 22 Nov 2018 14:59:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost (aaubervilliers-681-1-94-205.w90-88.abo.wanadoo.fr [90.88.35.205]) by mail.bootlin.com (Postfix) with ESMTPSA id 297442072F; Thu, 22 Nov 2018 14:58:53 +0100 (CET) Date: Thu, 22 Nov 2018 14:58:53 +0100 From: Maxime Ripard To: Sakari Ailus Cc: Hans Verkuil , Hans Verkuil , Mauro Carvalho Chehab , Thomas Petazzoni , Laurent Pinchart , linux-media@vger.kernel.org, Andrzej Hajda , Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Mark Rutland , Rob Herring , Frank Rowand Subject: Re: [PATCH 3/5] media: sunxi: Add A10 CSI driver Message-ID: <20181122135853.4rpxb32d6ios5zac@flea> References: <20181115205106.thbkojnzdwmaeui3@flea> <20181121220102.6nn7uwu2c67zs6pz@mara.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3quxuh5gpkv3x7ke" Content-Disposition: inline In-Reply-To: <20181121220102.6nn7uwu2c67zs6pz@mara.localdomain> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --3quxuh5gpkv3x7ke Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Sakari, On Thu, Nov 22, 2018 at 12:01:03AM +0200, Sakari Ailus wrote: > On Thu, Nov 15, 2018 at 09:51:06PM +0100, Maxime Ripard wrote: > > Hi Hans, > >=20 > > Thanks for your review! I'll address the other comments you made. > >=20 > > On Tue, Nov 13, 2018 at 01:24:47PM +0100, Hans Verkuil wrote: > > > > +static int csi_probe(struct platform_device *pdev) > > > > +{ > > > > + struct sun4i_csi *csi; > > > > + struct resource *res; > > > > + int ret; > > > > + int irq; > > > > + > > > > + csi =3D devm_kzalloc(&pdev->dev, sizeof(*csi), GFP_KERNEL); > > >=20 > > > devm_kzalloc is not recommended: all devm_ memory is freed when the d= river > > > is unbound, but a filehandle might still have a reference open. > >=20 > > How would a !devm variant with a kfree in the remove help? We would > > still fall in the same case, right? >=20 > Not quite. For video nodes this is handled: the release callback gets cal= led > once there are no file handles open to the device. That may well be much > later than the device has been unbound from the driver. I might be missing something, but how the release callback will be able to get the reference to the structure we allocated here so that it can free it? Thanks! Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --3quxuh5gpkv3x7ke Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCW/a2HQAKCRDj7w1vZxhR xeYmAP9yPJlEhJ3rYDcEmTa7fnMkqikKNh6ty85vrrlg+FCEBgD/Xvwbv+mZKRbm TOU2UTA8aEpKmFShx9jEqRewxE1iDQw= =+FLC -----END PGP SIGNATURE----- --3quxuh5gpkv3x7ke--