diff options
author | Sergey Vlasov <vsu@altlinux.ru> | 2006-04-07 09:04:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-05-12 18:54:41 -0400 |
commit | 7a766f9ddd74b50d6069f054a3004ece0439f5c1 (patch) | |
tree | db88a76df1cf9dade1804bba8f1175a6556939e5 /drivers | |
parent | a7286033f951ebc78527e63f335516ea2f95e142 (diff) |
V4L/DVB (3738): Saa7134: Fix oops with disable_ir=1
When disable_ir=1 parameter is used, or when saa7134_input_init1()
fails for any other reason, dev->remote will remain NULL, and the
driver will oops in saa7134_hwinit2(). Therefore dev->remote must be
checked before dereferencing.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 13de05532e0a..f0c2111f14ad 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
@@ -548,6 +548,8 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
548 | if (report & SAA7134_IRQ_REPORT_GPIO16) { | 548 | if (report & SAA7134_IRQ_REPORT_GPIO16) { |
549 | switch (dev->has_remote) { | 549 | switch (dev->has_remote) { |
550 | case SAA7134_REMOTE_GPIO: | 550 | case SAA7134_REMOTE_GPIO: |
551 | if (!dev->remote) | ||
552 | break; | ||
551 | if (dev->remote->mask_keydown & 0x10000) { | 553 | if (dev->remote->mask_keydown & 0x10000) { |
552 | saa7134_input_irq(dev); | 554 | saa7134_input_irq(dev); |
553 | } | 555 | } |
@@ -564,6 +566,8 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
564 | if (report & SAA7134_IRQ_REPORT_GPIO18) { | 566 | if (report & SAA7134_IRQ_REPORT_GPIO18) { |
565 | switch (dev->has_remote) { | 567 | switch (dev->has_remote) { |
566 | case SAA7134_REMOTE_GPIO: | 568 | case SAA7134_REMOTE_GPIO: |
569 | if (!dev->remote) | ||
570 | break; | ||
567 | if ((dev->remote->mask_keydown & 0x40000) || | 571 | if ((dev->remote->mask_keydown & 0x40000) || |
568 | (dev->remote->mask_keyup & 0x40000)) { | 572 | (dev->remote->mask_keyup & 0x40000)) { |
569 | saa7134_input_irq(dev); | 573 | saa7134_input_irq(dev); |
@@ -676,7 +680,7 @@ static int saa7134_hwinit2(struct saa7134_dev *dev) | |||
676 | SAA7134_IRQ2_INTE_PE | | 680 | SAA7134_IRQ2_INTE_PE | |
677 | SAA7134_IRQ2_INTE_AR; | 681 | SAA7134_IRQ2_INTE_AR; |
678 | 682 | ||
679 | if (dev->has_remote == SAA7134_REMOTE_GPIO) { | 683 | if (dev->has_remote == SAA7134_REMOTE_GPIO && dev->remote) { |
680 | if (dev->remote->mask_keydown & 0x10000) | 684 | if (dev->remote->mask_keydown & 0x10000) |
681 | irq2_mask |= SAA7134_IRQ2_INTE_GPIO16; | 685 | irq2_mask |= SAA7134_IRQ2_INTE_GPIO16; |
682 | else if (dev->remote->mask_keydown & 0x40000) | 686 | else if (dev->remote->mask_keydown & 0x40000) |