[Patch] saa7134: fix NULL dereference at suspend time for cards without IR receiver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there!

I played around with some new (not supported) card based on saa7134
(Avermedia dvb-s pro A700).
This lead to suspend crashing when saa7134 module was loaded.

Reason is: saa7134_suspend unconditionally calls  saa7134_ir_stop:

void saa7134_ir_stop(struct saa7134_dev *dev)
{
        if (dev->remote->polling)
                del_timer_sync(&dev->remote->timer);
}

So this must fail if dev->remote is NULL. cx88 driver seems to have the same 
layout, but this one already has the NULL-check implemented.

This patch now checks dev->remote before calling saa7134_ir_stop.

Matthias
-- 
Matthias Schwarzott (zzam)
saa7134: fix NULL dereference at suspend time for cards without IR receiver

Calling saa7134_ir_stop at suspend is no good idea
for saa7134 cards without remote control.

Signed-off-by: Matthias Schwarzott <zzam@xxxxxxxxxx>

Index: v4l-dvb/linux/drivers/media/video/saa7134/saa7134-core.c
===================================================================
--- v4l-dvb.orig/linux/drivers/media/video/saa7134/saa7134-core.c
+++ v4l-dvb/linux/drivers/media/video/saa7134/saa7134-core.c
@@ -1284,7 +1284,9 @@ static int saa7134_suspend(struct pci_de
 	del_timer(&dev->video_q.timeout);
 	del_timer(&dev->vbi_q.timeout);
 	del_timer(&dev->ts_q.timeout);
-	saa7134_ir_stop(dev);
+
+	if (dev->remote)
+		saa7134_ir_stop(dev);
 
 	pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state));
 	pci_save_state(pci_dev);
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux