From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.bootlin.com ([62.4.15.54]:55382 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbeKPHAn (ORCPT ); Fri, 16 Nov 2018 02:00:43 -0500 Date: Thu, 15 Nov 2018 21:51:06 +0100 From: Maxime Ripard To: Hans Verkuil Cc: Hans Verkuil , Sakari Ailus , 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: <20181115205106.thbkojnzdwmaeui3@flea> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="i43yylcxwdmh6fzi" Content-Disposition: inline In-Reply-To: Sender: linux-media-owner@vger.kernel.org List-ID: --i43yylcxwdmh6fzi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Hans, Thanks for your review! I'll address the other comments you made. 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 driver > is unbound, but a filehandle might still have a reference open. How would a !devm variant with a kfree in the remove help? We would still fall in the same case, right? Thanks! Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --i43yylcxwdmh6fzi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCW+3cOgAKCRDj7w1vZxhR xV+oAP9nvGAFGsjofaPgBIoiu7YLqY9AwaWzhDFI7MH/Z+4j4gEA9Q/7d+BgUz1T NV6gRwThQqyyU/nCrI4qaOItr7V89QI= =j6qY -----END PGP SIGNATURE----- --i43yylcxwdmh6fzi--