On Wed Aug 19 14:33:51 2026 +0800, Linkai Gong wrote:
> hws_probe() initializes max_channels (always 4) control handlers, but
> register/unregister only walk cur_max_video_ch (1 or 2 on smaller
> chips). The extra handlers are never freed.
> 
> Initialize the same number of channels that cleanup uses.
> 
> Fixes: ba07fd2f5742 ("media: pci: add AVMatrix HWS capture driver")
> Cc: [email protected]
> Signed-off-by: Linkai Gong <[email protected]>
> Reviewed-by: Ben Hoff <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/pci/hws/hws_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---

diff --git a/drivers/media/pci/hws/hws_pci.c b/drivers/media/pci/hws/hws_pci.c
index 75be77d6c197..f06e60dc2ee6 100644
--- a/drivers/media/pci/hws/hws_pci.c
+++ b/drivers/media/pci/hws/hws_pci.c
@@ -441,7 +441,7 @@ static int hws_probe(struct pci_dev *pdev, const struct 
pci_device_id *pci_id)
        hws_init_video_sys(hws, false);
 
        /* 5) Init channels (video state, locks, vb2, ctrls) */
-       for (i = 0; i < hws->max_channels; i++) {
+       for (i = 0; i < hws->cur_max_video_ch; i++) {
                ret = hws_video_init_channel(hws, i);
                if (ret) {
                        dev_err(&pdev->dev, "video channel init failed 
(ch=%d)\n", i);
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to