Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3969744rwb; Tue, 20 Sep 2022 07:11:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SdWVOL9CTDhha495oA/mpvtz8DiAkIiw8yy0CEmULl3Qy2aR2UmQu4oxi+ThTZjjcWIRD X-Received: by 2002:a05:6402:2711:b0:451:327a:365f with SMTP id y17-20020a056402271100b00451327a365fmr19809534edd.315.1663683103286; Tue, 20 Sep 2022 07:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663683103; cv=none; d=google.com; s=arc-20160816; b=irY8bVJ8yUiGlaG84T86IU/ztJ/Dj5a544AmLEQMQopfqbLxKgggteamtkuAbCLfoT MDxe2sZgaBIqkc3zvGom9yAlm+1AJgB90bFuIjYe5mQp+tlSfoHMyiid6s3ch4s5G8Lw caUmXMvGENhiqxrwagcUVyWBAkolYd/c0No9nwwM3Dx0p4kBBDvQQExzF9Oypk5H63LY 5eWBa0TTRHL1NNxLuddwPUBisnjug7/Z0uunmoQ+laOh3weBOygkE2gXY3blivWl+bmE dPmfu2ULqEVkeOWEGGQAIETddy+uuaV9C1jc0RiQyyPczr7MmYIREAEnJDpJgY7+hImQ LOqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=GF6cPJVtOJVbesTQZDktFClOlGzeyriaAidJCIdaM/M=; b=K8DBvA/7Y8NzTI0fHVlZzU94PT+DEkOamvGJE6Y32qBBHd8IfIUUwUumAMa7Lculy3 n1/RbbELEVY2qqFxiCvdgvo5ZosxfFFks4b6Dg1g7Xdl6JZ2lWQaTR8xcHjoH35QL9C1 cjwEwdYZ6lh9RYwN13lViEroUwDSjm0swBykbpNuLTYPo99xN+p1+FFfWq1nUjr3+Jpu MZtK9DMyN8plz6QHFQZFF6CtGFIm4uX+atTG0GXq6IZgsNMP2MJDSpe+zZMLiBFMGAO9 vvl2IQAnofCQHEEs0gyWermmlQVIBgIRC2g93ycXWBsWfdSZrZCs8dPr8uoYkJfN0VWr u6bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=IFfCR6B4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a30-20020a50c31e000000b0045443056737si130524edb.311.2022.09.20.07.11.16; Tue, 20 Sep 2022 07:11:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=IFfCR6B4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231254AbiITOHy (ORCPT + 99 others); Tue, 20 Sep 2022 10:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbiITOHu (ORCPT ); Tue, 20 Sep 2022 10:07:50 -0400 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE3985A15F; Tue, 20 Sep 2022 07:07:47 -0700 (PDT) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id E9E7D100017; Tue, 20 Sep 2022 14:07:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1663682865; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GF6cPJVtOJVbesTQZDktFClOlGzeyriaAidJCIdaM/M=; b=IFfCR6B4r/Krfaqb3kk+lbwGk74VHj2gL6Kwed5+b1fCnmg0uZI5FMDZPRpzvk2s3Evpd7 gedyWriqEBppAhbih6GFGNFHL5GbSXF1SwKEYDG0i0MyEA4rYAf0q7t9EXi/yAJGW4TX8s 2/6oRLDYieJen4O8dkJy+WHCJe+D7u5kJEtrSLTzYn/fU1obPZdjN+//hhxIKnu0YKKSY3 +Qll5cxtQvGxoVI4YsQFQYTlu22WqF7XZC2FzFiksGrgPtPEmqw45ggMYxBAU0bo8Eows8 D2s10PhkdCabDQt70cDFxcfS2G4QVOX+E1BvtCGo2rG3LP6v5jz1TJOGEl2S7A== Date: Tue, 20 Sep 2022 16:07:43 +0200 From: Paul Kocialkowski To: Rafael Mendonca Cc: Mauro Carvalho Chehab , Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: i2c: ov5648: Free V4L2 fwnode data on unbind Message-ID: References: <20220919023247.731106-1-rafaelmendsr@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zaB1nv5BiLMNa+jQ" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zaB1nv5BiLMNa+jQ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Rafael, On Tue 20 Sep 22, 10:58, Rafael Mendonca wrote: > On Tue, Sep 20, 2022 at 03:25:20PM +0200, Paul Kocialkowski wrote: > > Hi Rafael, > >=20 > > On Sun 18 Sep 22, 23:32, Rafael Mendonca wrote: > > > The V4L2 fwnode data structure doesn't get freed on unbind, which lea= ds to > > > a memleak. > >=20 > > Thanks for this patch, good catch! > >=20 > > I agree with Jacopo, you shouldn't add a newline before the call. >=20 > Thanks for the review, I'll send a v2. As the code for the ov5648 is > similar to the ov8865, and in the 8865 there is this blank line before > the v4l2_fwnode_endpoint_free() call, I thought it might be good to keep > the same style here, that's why this empty line ended up appearing here. Understood! I'd be tempted to make a cosmetic fix for 8865 but will probably wait to group it with functional changes. Cheers, Paul > > Feel free to send a v2 with that fixed and include my: > >=20 > > Reviewed-by: Paul Kocialkowski > >=20 > > Cheers, > >=20 > > Paul > >=20 > > > Fixes: e43ccb0a045f ("media: i2c: Add support for the OV5648 image se= nsor") > > > Signed-off-by: Rafael Mendonca > > > --- > > > drivers/media/i2c/ov5648.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > >=20 > > > diff --git a/drivers/media/i2c/ov5648.c b/drivers/media/i2c/ov5648.c > > > index dfcd33e9ee13..95850f06112b 100644 > > > --- a/drivers/media/i2c/ov5648.c > > > +++ b/drivers/media/i2c/ov5648.c > > > @@ -2598,6 +2598,8 @@ static int ov5648_remove(struct i2c_client *cli= ent) > > > mutex_destroy(&sensor->mutex); > > > media_entity_cleanup(&subdev->entity); > > > =20 > > > + v4l2_fwnode_endpoint_free(&sensor->endpoint); > > > + > > > return 0; > > > } > > > =20 > > > --=20 > > > 2.34.1 > > >=20 > >=20 > > --=20 > > Paul Kocialkowski, Bootlin > > Embedded Linux and kernel engineering > > https://bootlin.com >=20 >=20 --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --zaB1nv5BiLMNa+jQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmMpyS8ACgkQ3cLmz3+f v9F2rgf9GWJRbsfTRwscJGXsW2i6pIThfLIysGiwYV+1lqVNbTCzLA4z1XckxHrw 06zL/v+ZIq0KROZXE5Z3DTOBhnfXd0xVnfrVlY145dgRxFsg44icsjHtf/NFcS/b F5vj+kGhuddzFi7Vdg9HtuZFexzZBQCZ3of2+1E3bjsuzqt000DEeoVHLnuqg4vP UWsp/LrqgM1197fw+ylhJpE4RJWQSAreMywhvaabfJQO28KkqDMTJQI/AvOeU/6h eAzIIG43OiNtIjedkJWb3dS6ZYWgUeAclKQcx5JG24msZub0UZyKKoZa+ycTMb5/ jvFgrKg6TT0oH4W2ftvPLQ5xSxCFUQ== =jW0C -----END PGP SIGNATURE----- --zaB1nv5BiLMNa+jQ--