Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3915937rwb; Tue, 20 Sep 2022 06:33:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yp67yu2zHfYn9Si0sMU2NKOfOOsGcg9a2XLQ/0lu9/XaonsFmp2KOgr93aCySTfO+I5Pt X-Received: by 2002:a65:6e0f:0:b0:43a:1cd4:4ae6 with SMTP id bd15-20020a656e0f000000b0043a1cd44ae6mr9051860pgb.289.1663680795452; Tue, 20 Sep 2022 06:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663680795; cv=none; d=google.com; s=arc-20160816; b=eIRblbwBdbKCaPOSUPDOCQkVlRuyiu/M53bPXT9oR32iykcJdplpfBW/bQcAoWzbky fbcK3CAkT31tXVBIFLIvZwQGBODP0Q8zTS2M1wsDGA/BXiXNnjA8+YsWnrHd9qrv6jWr zvbzWMt0gzQSnR+Ud7cC3p3qxLhuIEJ+blhzOfw4jv7klXBigqZfAxxZ6zfgKiNcz57F +pqpjJso6LY7vw1lDDldxcECai/uIzK1wS96k5FuTDMk5UN6J+Kfw3lZXojuXEd87iYn eBmiQlqQ9FjQ7ELiAXUpwN/4d7wMoc6Mcpll4p7njx7GaS31v9RDJqNAeTlO/wM3KMOI 13BA== 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; bh=r4ttE7hR8fZOPHhGXi7AIGskauOHX+5dPAj2WvRa0LU=; b=NaD5FJ/QczI2tDojJtzFBzsZYC7fuiz3LrCzTA0Rcze7NGOyqZr3MlOsRILqlVoQ04 2maIr3bSwtV8phMbugLMn0tl92zE8GpuJdvaM7uex3LpQIUuE2c9iai2bxf64/t6jAx/ ZxpmGJhvgNsYDGBkinvTeIeei+fnuqBNYH3+2hH9X030sJ8fWk/HuybLEhUHBoqXzmNu g40zHpsnWlBeWgESiw+dfRLIBTTZSyUygwUHLaTGvVz0obByr48UyhbtdIotoeken+kx 606o4ImS+64dep7rEC4/pSYgktN9HG5GXFVly6FkDyOD/fSsl8Y5C2eUoaM5KWELfvvW GF3A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p20-20020a056a000b5400b0053e9fbac2a8si1825363pfo.102.2022.09.20.06.32.57; Tue, 20 Sep 2022 06:33:15 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231299AbiITMqp (ORCPT + 99 others); Tue, 20 Sep 2022 08:46:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231314AbiITMqn (ORCPT ); Tue, 20 Sep 2022 08:46:43 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 768BC6524E; Tue, 20 Sep 2022 05:46:41 -0700 (PDT) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id D278140011; Tue, 20 Sep 2022 12:46:37 +0000 (UTC) Date: Tue, 20 Sep 2022 14:46:35 +0200 From: Jacopo Mondi To: Rafael Mendonca Cc: Mauro Carvalho Chehab , Paul Kocialkowski , 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: <20220920124635.jhprooo67daaivq7@lati> References: <20220919023247.731106-1-rafaelmendsr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220919023247.731106-1-rafaelmendsr@gmail.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 Hi Rafael On Sun, Sep 18, 2022 at 11:32:46PM -0300, Rafael Mendonca wrote: > The V4L2 fwnode data structure doesn't get freed on unbind, which leads to > a memleak. > > Fixes: e43ccb0a045f ("media: i2c: Add support for the OV5648 image sensor") > Signed-off-by: Rafael Mendonca > --- > drivers/media/i2c/ov5648.c | 2 ++ > 1 file changed, 2 insertions(+) > > 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 *client) > mutex_destroy(&sensor->mutex); > media_entity_cleanup(&subdev->entity); > > + v4l2_fwnode_endpoint_free(&sensor->endpoint); > + Nit: all the other function calls are in a single block, this one doesn't deserve an empty line before it. Nit apart, the patch is a good fix. > return 0; > } > > -- > 2.34.1 >