Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp510099imu; Thu, 22 Nov 2018 00:50:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/WGXL5D66UZ6BWOrkc4K8vSI46wqZlQwklqIrdh2YSRvj2V0h5lOLT7uVlPK6xcE/jLCKI5 X-Received: by 2002:a63:6b08:: with SMTP id g8mr9160796pgc.119.1542876616630; Thu, 22 Nov 2018 00:50:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542876616; cv=none; d=google.com; s=arc-20160816; b=fVvBp6Dpa5QqiYwoqygHJGwKkCYSwvBPMwDkb1+QToHF9WNN06dAo4Fn+M4iIjPmbn gSOxT5gC5v7aZobbtGsS3c1qAdyalF3GCVOmAL8FFqV6ZLdofOZH2+USW4d06FNu0N0g X0S62KqEiC8APmQVtD6ODKUfNMuVv+oM010U9KAkX7gZSnQVpZ9+UzyAtwTWnKOqxuhy U1+LPk0Jsvm/VRp7ibx0TEQEfkZXxRif+6878osIE5MsPK/wFYog+B1CDm95GbUgGFBn YImAq9hD2Hs+0DaGvSItId2OLftn2395mFaTcOG6CCLQ5w6QNUIfmPw0fBknbV9U/Pim BJrA== 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=yHv6rQj1schMP8FEqRG+x36f1Y+RXZYm0Ok9rsy2yUY=; b=jxsccukxcG1ekoXl8JJD8uwphYM9dfttTMca6rh0mNFI19xK0M8YxECYIauje702Am 8j1tgJWsI4ot2Zn/wpLJ5P5uAG1Wrxjjg5vD8q1ddbVuUERPq4mCTgXOKVpG5wnkngCd iTqobt9WntHcJBo54g6EJnK0V43P9Q1XSpYvrdWbqV0G6ty+CaK5JlrQE9Y2O4UX2gOD +bZwUsKgjFIjsypS/TFpuc+tIFoDxxGjj8U9q49AX3jmQ2xwaqtKuX+Wi1FC+0XgN8t+ 1HsZOY6hbiZGsVMe73m8LmylOco1HXxoRtaepwAAbhvs4I2NgyY/xb2LOqg8mT116iJL SsHQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r77-v6si3570125pfa.69.2018.11.22.00.50.01; Thu, 22 Nov 2018 00:50:16 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732033AbeKVIhY (ORCPT + 99 others); Thu, 22 Nov 2018 03:37:24 -0500 Received: from mga18.intel.com ([134.134.136.126]:8258 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730599AbeKVIhX (ORCPT ); Thu, 22 Nov 2018 03:37:23 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Nov 2018 14:01:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,262,1539673200"; d="scan'208";a="108267661" Received: from uoffert-mobl1.ger.corp.intel.com (HELO mara.localdomain) ([10.252.30.150]) by fmsmga004.fm.intel.com with ESMTP; 21 Nov 2018 14:01:06 -0800 Received: from sailus by mara.localdomain with local (Exim 4.89) (envelope-from ) id 1gPaYR-0000Ls-P1; Thu, 22 Nov 2018 00:01:03 +0200 Date: Thu, 22 Nov 2018 00:01:03 +0200 From: Sakari Ailus To: Maxime Ripard 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: <20181121220102.6nn7uwu2c67zs6pz@mara.localdomain> References: <20181115205106.thbkojnzdwmaeui3@flea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181115205106.thbkojnzdwmaeui3@flea> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 09:51:06PM +0100, Maxime Ripard wrote: > 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 = devm_kzalloc(&pdev->dev, sizeof(*csi), GFP_KERNEL); > > > > 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? Not quite. For video nodes this is handled: the release callback gets called 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. -- Sakari Ailus sakari.ailus@linux.intel.com