V4L/DVB (3741): Budget-core doesn't check if register adapter fails
authorAndrew de Quincey <adq_dvb@lidskialf.net>
Thu, 6 Apr 2006 13:37:56 +0000 (10:37 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 25 Jun 2006 04:57:52 +0000 (01:57 -0300)
If you have more than DVB_MAX_ADAPTERS in your machine, this causes an oops.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/ttpci/budget-core.c

index ea2066d461fc95fcd9fe770d2e9c4fca34d72563..d8af690fa55c356ba6c3a55bea40adcb03d7223a 100644 (file)
@@ -400,7 +400,9 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
                budget->dev->name, budget->buffer_width, budget->buffer_height);
        printk("%s: dma buffer size %u\n", budget->dev->name, budget->buffer_size);
 
-       dvb_register_adapter(&budget->dvb_adapter, budget->card->name, owner);
+       if ((ret = dvb_register_adapter(&budget->dvb_adapter, budget->card->name, owner)) < 0) {
+               return ret;
+       }
 
        /* set dd1 stream a & b */
        saa7146_write(dev, DD1_STREAM_B, 0x00000000);