From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5CBF32F748 for ; Sun, 14 Jun 2026 16:56:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781456216; cv=none; b=CKMgjrtVMpEMt6SyBMgSB+4jiN8JKts1wL5cVEzt7nHhNjHNzAceR+pzdD/5i9GtycW2/q2jG0yURxtxLY+w6LIUYvOBt5XISG2ry5mvh/G+xk29tdhvFRj2z2pv8sb8LMz+tcW4J1O/j6DhlxX82QHr0pnRfBemUW1vaFRpBu4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781456216; c=relaxed/simple; bh=9JI68SRCRoyQz/f7w6vRQinxQ01p0+QlDdaGDWZEg2Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TJhd+Ce/06MNPL7SrRiMkmpeDLjBU0QxGZgibr2ukyR8epTHSyFMCNLl/b21WnRcJobIlp17uuI9dtx05zceEuakM7JxcpdiR0ZHbinB4tcD1i/WrwyVARmP/DMG7u7gJivfFDcA1lpSzbeMnvX3D7Z6hHGqDqhWj5OFdwchd3U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qx2aXI+q; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qx2aXI+q" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2c0c1e0b0faso15405205ad.0 for ; Sun, 14 Jun 2026 09:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781456215; x=1782061015; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fV7l28be5P+qBSslSEq0VtNafl/nMiAJlS2Suv7NaqI=; b=qx2aXI+qDYNl4qMmFzfSBR8pylQdSIzulJ6868aD61Q+PdeXh69t+qXYdf6ynMs0sE fPW0MOALlYTMHlu/2dWElP74nXqEEbTQ+tjRhiopnjDH5Zon0xjyAvDCGGhPsCFXYZfx c3/0ViX10KtGss5ey/7VMX6k6C+ZVaplN9T/4QFCr+IOZn6Ow0XTGMJNe/f2XnKkUb4l zwPSyBkCuXU54rzX7hXc+4l/NaHbslHED6Mo2SOpVtMfeOvp0xPfUWEDw4UDZnskpwza UOX+rvfPxJoBuiqQDRZFJq7AJKqmZDEn8yVti/CAZslyV/rkLjMfoBgDRr1MukScPQeJ okfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781456215; x=1782061015; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fV7l28be5P+qBSslSEq0VtNafl/nMiAJlS2Suv7NaqI=; b=AbvoAwnNQo9bgPFMdXssCzJm75sRDcNofvpIXqEuCIvTSats6Yw+7wXUkHW9bttNHn rtz1Tvj3oa1HYRaW0I8R0t0Ev+UsgJlqoWw5wA2l25ZUzbWnVccGmWXdy3wsi1vCTe6w H/Z+iQ+OmD92SqKCEAiLc33luyyEKEheZ8OEoGDTpBZy8cRWGoqmuNy31CD4GaRG5Vea K+bCGO/4Ho8E2Ho7jwvb+HjqhmPrcwkxuPLl3uw9Djm/qugZ2ZfLEG2I9pXulz1hr31R GWDFeRrEuSKA6PcjaKlG+VXbsseAfibtrSou8CnciecDAyKuIZyQAMRJXfR6sNgYfdmo 0xWQ== X-Forwarded-Encrypted: i=1; AFNElJ9S6Fqfo1bxCIWp0Iartm2WUMvOOQZYBDXALOenIff0DyrbncXCuCrVBxsOOItVO3+SUv3QAQ2orcfvuVw=@vger.kernel.org X-Gm-Message-State: AOJu0YwfzWjL0FwEMpdKAxbToYSjZmugY+Ot6aYMS5xBz/ScJ7BbQGAs u4iDGheNoEUw1KRB23qJ7ivXLMybXOIANLihgB8BN6h++WilxaSbcLrV X-Gm-Gg: Acq92OGqYnCVmKPSRniVdDTb2WMQuQkstLJl1F8xvSy8boWoYbBMIJEi70nGmKoHs+R dGzjmNUihG1uP8ORLpXRODlOm6+DOla9+ZlP0e/Jr2jvRHaWqHR6UijprNZh6fdE+3CSTlOPF07 eJTIchnwWHr7cCip8fFgPGqT1PmsegDs7r0xLfVejKHVyqnRP9jZPVV3dZIfZaBYwEjt30hJ4rV Vm0Sg4UQtS0oefB2X2l3WGEjQdWcxQDR0D6GFq2mKh9MmfhbNfrEBjbNurvIKB42GJ3yoZo837Z YIewgc4DEh3NVcg5s/DmwbKTpm678mucQAw7npR+18ms+e30KJ2eL3wPNwhk4IpLyYemmfRzmZ4 BVqOgeYqh7/zY2Zr/sC/RnzRJMzLrPFhBbVy+2qzAuyoxkHZLWwXQD28DqEL5CDZtt1ZozISIHS mVoOukwnMqWn3AFpEBWsPf5HTERSZT9lbhc6vB/WTjAXMeifClwWHc X-Received: by 2002:a17:903:291:b0:2c1:5a24:b4ed with SMTP id d9443c01a7336-2c4137dd98bmr117506995ad.37.1781456215105; Sun, 14 Jun 2026 09:56:55 -0700 (PDT) Received: from localhost.localdomain ([49.207.217.37]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c42f2e5590sm85284025ad.14.2026.06.14.09.56.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 14 Jun 2026 09:56:54 -0700 (PDT) From: Biren Pandya To: linux-media@vger.kernel.org, mchehab@kernel.org Cc: Biren Pandya , Sakari Ailus , linux-kernel@vger.kernel.org Subject: [PATCH 04/22] media: i2c: mt9v011: Add missing media_entity_cleanup() Date: Sun, 14 Jun 2026 22:25:41 +0530 Message-ID: <20260614165630.3896-5-birenpandya@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260614165630.3896-1-birenpandya@gmail.com> References: <20260614165630.3896-1-birenpandya@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The media_entity_pads_init() function initializes the media entity, but the driver forgets to call media_entity_cleanup() in the error paths and remove function. Add the missing calls to fix the API violation and prevent potential future memory leaks. Signed-off-by: Biren Pandya --- drivers/media/i2c/mt9v011.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/i2c/mt9v011.c b/drivers/media/i2c/mt9v011.c index 055b7915260a..b7ef8bff727d 100644 --- a/drivers/media/i2c/mt9v011.c +++ b/drivers/media/i2c/mt9v011.c @@ -520,6 +520,7 @@ static int mt9v011_probe(struct i2c_client *c) (version != MT9V011_REV_B_VERSION)) { v4l2_info(sd, "*** unknown micron chip detected (0x%04x).\n", version); + media_entity_cleanup(&sd->entity); return -EINVAL; } @@ -542,6 +543,7 @@ static int mt9v011_probe(struct i2c_client *c) v4l2_err(sd, "control initialization error %d\n", ret); v4l2_ctrl_handler_free(&core->ctrls); + media_entity_cleanup(&sd->entity); return ret; } core->sd.ctrl_handler = &core->ctrls; @@ -577,6 +579,7 @@ static void mt9v011_remove(struct i2c_client *c) v4l2_device_unregister_subdev(sd); v4l2_ctrl_handler_free(&core->ctrls); + media_entity_cleanup(&sd->entity); } /* ----------------------------------------------------------------------- */ -- 2.50.1 (Apple Git-155)