From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B87E1301486; Tue, 26 Aug 2025 11:21:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756207310; cv=none; b=CMMp8Pcinxt4YgkPwJHRP1ocj73GZLvJtEXpRN8iwLLbb+6Y0IX/kWOqwlWZCn0bpjygE2kL0jtUKC1iDPE5v9shsEI+JtZKsZtLSO+2+Thtj8crHZKFPkramRVHaAnrpbqR/hIdRlOdT4YHLHnW3MJFXT4cA7CKgw2VzU6vOSU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756207310; c=relaxed/simple; bh=zJNIWz6Ub7c9i+wI1Z2ZDXnnoBqe/RSM6+6x1iLhYiI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZyvId2k6FL2GdLnxaZqVfdo6NpM6yL/Z4Bn4iCJhSEGkooiX2B6giHLQlnDQzF8W+LR4W2HbOF4IpP1FAGaMCscSNR9NMyICGHD1hUxS7XTEi9t4DrK6vHiA4EeCAms7q98bB6SmrJnSaBl3nnvjsDBUDDDRspKbjClgLie0hl4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=AZyQa5eo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="AZyQa5eo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43325C4CEF1; Tue, 26 Aug 2025 11:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756207310; bh=zJNIWz6Ub7c9i+wI1Z2ZDXnnoBqe/RSM6+6x1iLhYiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AZyQa5eoIzezN0oR0KhYmqDrx/TVINZcufCzuEokpZhwUCuOvgQijBlIhQ8pjhsa5 xfK/fU0xMSxjZqvdsYZgovyMoW1SjzjwAsXxr3f+9S+wKK3qaZuQB137keEOcYTDOM wntOlPmWrbGRSNDdhWRBMrX+aCnqY9pg6fnZsTXA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Haoxiang Li , Dan Carpenter , Nicolas Dufresne , Hans Verkuil Subject: [PATCH 6.16 132/457] media: imx: fix a potential memory leak in imx_media_csc_scaler_device_init() Date: Tue, 26 Aug 2025 13:06:56 +0200 Message-ID: <20250826110940.633506637@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110937.289866482@linuxfoundation.org> References: <20250826110937.289866482@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Haoxiang Li commit fc5f8aec77704373ee804b5dba0e0e5029c0f180 upstream. Add video_device_release() in label 'err_m2m' to release the memory allocated by video_device_alloc() and prevent potential memory leaks. Remove the reduntant code in label 'err_m2m'. Fixes: a8ef0488cc59 ("media: imx: add csc/scaler mem2mem device") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li Reviewed-by: Dan Carpenter Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/staging/media/imx/imx-media-csc-scaler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/staging/media/imx/imx-media-csc-scaler.c +++ b/drivers/staging/media/imx/imx-media-csc-scaler.c @@ -912,7 +912,7 @@ imx_media_csc_scaler_device_init(struct return &priv->vdev; err_m2m: - video_set_drvdata(vfd, NULL); + video_device_release(vfd); err_vfd: kfree(priv); return ERR_PTR(ret);