From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 385A4C43441 for ; Thu, 15 Nov 2018 20:51:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F33362087A for ; Thu, 15 Nov 2018 20:51:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F33362087A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389014AbeKPHAn (ORCPT ); Fri, 16 Nov 2018 02:00:43 -0500 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 Received: by mail.bootlin.com (Postfix, from userid 110) id 2EA7320746; Thu, 15 Nov 2018 21:51:17 +0100 (CET) Received: from localhost (lfbn-1-10718-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.bootlin.com (Postfix) with ESMTPSA id EE93F20736; Thu, 15 Nov 2018 21:51:06 +0100 (CET) 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: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --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--