From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 E7A2E32F748 for ; Sun, 14 Jun 2026 16:56:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781456213; cv=none; b=lTTCHva3JzIpI22cPm87369G7hvFXkP37Z6s/shE9nI3lL/mRjJh7v1/iU8GAbSjB/5zKkD9fBsffSo9fGL6cXdslSS/2J4d4Yht714GEDurUK0J0S60A5+5wYM1aKLmNT9HFc9/xKOmQGD3xAlUH+/g4CHFchS/ZhvJXG1klqQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781456213; c=relaxed/simple; bh=/bJsLoWCdPKFWO2yXF59OTcCR9iBe2ZCAer13InhKEE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UQ/2+rUushbmC5z4JD/RrZetF718F+Cd4We63tTjj6SQ56LDMHlKoL0/9BuxH5kWWCxNCj6i9mcjwIK0FdeJLgvOWBYvp89ErweDo2iIfRxIUYb4sxpTX8jvo21X5Cug7MAyD23d2TcXCLloOVGjSAioRMF+kCndZs9yJsvNm14= 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=koXF9ifU; arc=none smtp.client-ip=209.85.214.178 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="koXF9ifU" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2c0c1e0b0faso15405105ad.0 for ; Sun, 14 Jun 2026 09:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781456211; x=1782061011; 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=Y9PgnXeogz6Rgu6OO1LTN8h5DeE9zNp79XgO8N3hk/A=; b=koXF9ifU3+zFqfNolfaWJZ3eyUoTDBbx341/cA+hIUSFcqHA36FkO0+vjrF36RhCp9 AZgbALrW+K1CsqqYmFDyIGDdxiHZnEx2auqCJf4gOmSrWq4nKg9W5pfa41F6X4pKk1vU oIvEInbuxWB1jtSpdgiozbFm5UDdGYTaqUOnJzweuihhjYd0Iohkx/fZMg4UdT56RwdQ GdiOE7csSaDxOAYXcfubLg8pjrPBxM5t9oySUlDUNfEjUhHfOZt0QCaUEZx1iZVh/eJF ZouYi4EA108lvqHPemalkzRn58rspJxAuTq6W1GdpuN6ta3IbOa4QI+ASRwoufg1BSlp PCmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781456211; x=1782061011; 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=Y9PgnXeogz6Rgu6OO1LTN8h5DeE9zNp79XgO8N3hk/A=; b=QCw5sqm/EXJlSaij6gYC+UaqIrAM54dgEHVpOQBHfZcd6PZ3Jez4Q9+e4rVprA76Lt YZoTOxGi19Qt3RxJrsq2JmfeTWuQa20Hl2fZI9mZaS4hOZFfVZIAzh34kSeOdVLA59NU 4lZ0sLDTaFMMWEVhfSnG9ijx2i2tf/rCLpJKXNfLVgpqJLvDU1lx4AIZiMhBWS48S6OX asiWZKdEEyPT0m3q6cqtyrvU+Oq5FVcR1SRPKbA5dCdi0TZTymEdAtrcPbRASnX1+cNP 4TRctUOn+jbbvzi72Tqm6w66eFpy0u37IKueBbwTFZ0PZ8IjyXv/PWvCA/Bk9ItpsY/8 qETQ== X-Forwarded-Encrypted: i=1; AFNElJ8P0XtjqqDaDTXD9G7VHFnW2qL9GMqGatv9851wa7AxJTLE1TLbl9gSYxNfUJIr1RUXa/eWtuAZd/wOwsA=@vger.kernel.org X-Gm-Message-State: AOJu0YxkH19w2oOA9Ulb8g1nfEUtN0twuWXOcNTWuhV3KY7Mau17MQiC iJmCr9FIFKajk8yag98kghtuZBWbmXYS4dRPcI0cGsXwFYiyYvoYzAdY X-Gm-Gg: Acq92OHmIxTDSmRNz6fSr/XEIL3XDKsG66Tyb/PxFZbpx+ALhU/7RO92+VP116tS0mu CXf08ORh0+trux0Q34QtRaJ/D6nqDYhZjeO7GPv9EdSzG0vKm5ZtKADc15445OqbCS007wd/9dD DQuLn8ObI6MnY9oVkfiBmeiD/fNcRznpIJ+urUcf8wUqo3T8V/0UhVc2dlpdYtV/sswN2ItS0dt H5ScDLx0+JD0N/cB64p6bkeR4aK8PeGUbp/OkPVut3kBWdqPznCoMrWMNj0lYojZXtecIUIgEay e+RLMMxPzARUO7AJDXOIw7wsJn3RXvqhD8LkACGNUmDwcFxc4B4CZ44/Saw8X9QGVao3HaCtIKr Zznl4kcg60KLDCOEK24udOCK/BPq6ihOW3RU3kaImPisfq4vqmSEbG75gsuMCaYtLo3iUsZLEBY qmJ3qZuBE9pBf+p7U2KnXXCCAaB9iyxTxeySrAmXFBcasYT4xB6WwxUMFtUNorqww= X-Received: by 2002:a17:902:c404:b0:2c2:245a:3366 with SMTP id d9443c01a7336-2c412c30b6amr123734735ad.27.1781456211218; Sun, 14 Jun 2026 09:56:51 -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.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 14 Jun 2026 09:56:50 -0700 (PDT) From: Biren Pandya To: linux-media@vger.kernel.org, mchehab@kernel.org Cc: Biren Pandya , linux-kernel@vger.kernel.org Subject: [PATCH 03/22] media: i2c: msp3400-driver: Add missing media_entity_cleanup() Date: Sun, 14 Jun 2026 22:25:40 +0530 Message-ID: <20260614165630.3896-4-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/msp3400-driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c index 4c0b0ad68c08..d977a6039e6c 100644 --- a/drivers/media/i2c/msp3400-driver.c +++ b/drivers/media/i2c/msp3400-driver.c @@ -812,6 +812,7 @@ static int msp_probe(struct i2c_client *client) int err = hdl->error; v4l2_ctrl_handler_free(hdl); + media_entity_cleanup(&sd->entity); return err; } @@ -865,6 +866,7 @@ static void msp_remove(struct i2c_client *client) msp_reset(client); v4l2_ctrl_handler_free(&state->hdl); + media_entity_cleanup(&state->sd.entity); } /* ----------------------------------------------------------------------- */ -- 2.50.1 (Apple Git-155)