]> git.neil.brown.name Git - history.git/commitdiff
ieee1394: Fix possible NULL ptr dereference with calls to find_ctx()
authorBen Collins <bcollins@debian.org>
Sun, 13 Jun 2004 06:13:46 +0000 (02:13 -0400)
committerBen Collins <bcollins@debian.org>
Sun, 13 Jun 2004 06:13:46 +0000 (02:13 -0400)
Submitted-by: Hiromasa YOSHIMOTO <yosimoto@limu.is.kyushu-u.ac.jp>
Signed-off-by: Ben Collins <bcollins@debian.org>
drivers/ieee1394/video1394.c

index a9b92c1eda9761b30e68fa6c90fc70f07f545682..7a757fc43f1d90082428b2e8004dc1d4938196e3 100644 (file)
@@ -864,6 +864,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
                        return -EFAULT;
 
                d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
+               if (d == NULL) return -EFAULT;
 
                if ((v.buffer<0) || (v.buffer>d->num_desc)) {
                        PRINT(KERN_ERR, ohci->host->id,
@@ -926,6 +927,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
                        return -EFAULT;
 
                d = find_ctx(&ctx->context_list, OHCI_ISO_RECEIVE, v.channel);
+               if (d == NULL) return -EFAULT;
 
                if ((v.buffer<0) || (v.buffer>d->num_desc)) {
                        PRINT(KERN_ERR, ohci->host->id,
@@ -1009,6 +1011,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
                        return -EFAULT;
 
                d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
+               if (d == NULL) return -EFAULT;
 
                if ((v.buffer<0) || (v.buffer>d->num_desc)) {
                        PRINT(KERN_ERR, ohci->host->id,
@@ -1112,6 +1115,7 @@ static int video1394_ioctl(struct inode *inode, struct file *file,
                        return -EFAULT;
 
                d = find_ctx(&ctx->context_list, OHCI_ISO_TRANSMIT, v.channel);
+               if (d == NULL) return -EFAULT;
 
                if ((v.buffer<0) || (v.buffer>d->num_desc)) {
                        PRINT(KERN_ERR, ohci->host->id,