Skip to content

Commit

Permalink
V4L/DVB (6325): Double-free in cx23885_initdev
Browse files Browse the repository at this point in the history
Both cx23885_initdev and cx23885_dev_setup free the device in their
error path so a failure in the latter causes a double-free. Since
cx23885_dev_setup is only called from cx23885_initdev, it should be safe
to remove its deallocation and leave the cleanup up to the allocating
function.

Coverity CID 1922.

Signed-off-by: Florin Malita <fmalita@gmail.com>
CC: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Florin Malita authored and Mauro Carvalho Chehab committed Oct 22, 2007
1 parent a13625c commit fcf94c8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/media/video/cx23885/cx23885-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
dev->pci->subsystem_device);

cx23885_devcount--;
goto fail_free;
return -ENODEV;
}

/* PCIe stuff */
Expand Down Expand Up @@ -835,10 +835,6 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
}

return 0;

fail_free:
kfree(dev);
return -ENODEV;
}

void cx23885_dev_unregister(struct cx23885_dev *dev)
Expand Down

0 comments on commit fcf94c8

Please sign in to comment.