]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: pci: zoran: fix potential memory leak in zoran_probe()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Thu, 12 Mar 2026 12:32:56 +0000 (18:02 +0530)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 16 Mar 2026 15:30:21 +0000 (16:30 +0100)
The memory allocated for codec in videocodec_attach() is not freed in
one of the error paths, due to an incorrect goto label. Fix the label
to free it on error.

Fixes: 8f7cc5c0b0eb ("media: staging: media: zoran: introduce zoran_i2c_init")
Cc: stable@vger.kernel.org
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/pci/zoran/zoran_card.c

index d81facf735d92069297c8d52eeb2359a22f040cd..f707bdc1fb0f1dfa04645682679e05159cae80ee 100644 (file)
@@ -1373,7 +1373,7 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                }
                if (zr->codec->type != zr->card.video_codec) {
                        pci_err(pdev, "%s - wrong codec\n", __func__);
-                       goto zr_unreg_videocodec;
+                       goto zr_detach_codec;
                }
        }
        if (zr->card.video_vfe != 0) {