From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 8663D52D2A0 for ; Wed, 9 Sep 2026 11:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788951649; cv=none; b=lUFZrB5WZQdFeCtHFZCx2YLaIQFKPHrIK95i0vletrJErm0vp17uPfjXXRPNbIl8QabNjihtdPNv+kRWwj62JJrEj3BDlRXlh35FsQ6wzQcVh2iFb6f+hB2qQfmhJnoSIcn1vOscwKmltA9lTL3c3UJMCjR23hkpGOXqTW/5Gnw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788951649; c=relaxed/simple; bh=v//YMrz0o9uyIH7F6msPXnKQfaQ0vd2O6kp/ztebChU=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=T1hKCODjmS+S83sxcESwvWF2ahz3ZcBbMa6ejvJYbJ28DGEWurkbWc81Jazv65yOxuMpIzYydL511uhLwoc3izTkXQEcmHXrfU4WpAa7D5tZGTu2M+FeAN+iBtyssipDZcgCpcYqWXC+MqLT4Dt8QzZWXRl/x10FqRV0oDwenuk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=bCyCZAje; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="bCyCZAje" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6818C1F00A3D; Wed, 9 Sep 2026 11:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788951645; bh=LLSrZ81RihwhZ/kNDXQUBJfnNp1BO6CgL+ty6M59cz4=; h=Subject:To:Cc:From:Date; b=bCyCZAje1/H8a/1oV+0RydVw44fNT4n0kVKp85Rdtgh+aQl5+0gCnSd0e9YoBaxEi U4E0PGCm84Rtgmml1v1mRwORszux6JJzRGaVNGUQBxLdA+P7yShfYIXa6S4++Wkq8f 1qrqbo4dJoZvHnCl+1Pcjkqq4/kDEdmMx48ftgBc= Subject: FAILED: patch "[PATCH] media: zoran: Avoid freeing a registered video_device twice" failed to apply to 5.15-stable tree To: ruoyuw560@gmail.com,hverkuil+cisco@kernel.org Cc: From: Date: Wed, 09 Sep 2026 12:52:19 +0200 Message-ID: <2026090919-ricotta-twitter-442e@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 0735e0b5a96761a9ce277a238e834008ad92a0a5 # git commit -s git send-email --to '' --in-reply-to '2026090919-ricotta-twitter-442e@gregkh' --subject-prefix 'PATCH 5.15.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 0735e0b5a96761a9ce277a238e834008ad92a0a5 Mon Sep 17 00:00:00 2001 From: Ruoyu Wang Date: Wed, 8 Jul 2026 22:33:49 +0800 Subject: [PATCH] media: zoran: Avoid freeing a registered video_device twice zoran_init_video_device() installs zoran_vdev_release() as the video_device release callback through zoran_template. After video_register_device() succeeds, video_unregister_device() drops the registered video_device reference and the V4L2 core eventually invokes that release callback, which kfree()s the video_device. zoran_exit_video_devices() called video_unregister_device() and then kfree(zr->video_dev), so device teardown could free the same video_device twice. Remove the direct kfree() and clear the cached pointer after unregistering. The pre-registration failure path keeps its manual free because the video_device was not registered there. This issue was found by a static analysis checker and confirmed by manual source review. Fixes: 82e3a496eb56 ("media: staging: media: zoran: move videodev alloc") Cc: stable@vger.kernel.org Signed-off-by: Ruoyu Wang Signed-off-by: Hans Verkuil diff --git a/drivers/media/pci/zoran/zoran_card.c b/drivers/media/pci/zoran/zoran_card.c index 8bcf355a5418..e5ff407318df 100644 --- a/drivers/media/pci/zoran/zoran_card.c +++ b/drivers/media/pci/zoran/zoran_card.c @@ -886,7 +886,7 @@ static int zoran_init_video_device(struct zoran *zr, struct video_device *video_ static void zoran_exit_video_devices(struct zoran *zr) { video_unregister_device(zr->video_dev); - kfree(zr->video_dev); + zr->video_dev = NULL; } static int zoran_init_video_devices(struct zoran *zr)