OpenCloudOS-Kernel/drivers/net/can
Julia Lawall 951f2f960e drivers/net/can/sja1000/plx_pci.c: eliminate double free
In this code, the failure_cleanup label calls the function
plx_pci_del_card, which frees everything in the card->net_dev array.  dev
is placed in this array immediately after allocation, so the two subsequent
jumps to failure_cleanup should not also call free_sja1000dev, but the
second one does.

If plx_pci_check_sja1000 fails, then free_sja1000dev is also called on
dev.  Because dev is already in the card->net_dev array, this implies that
when plx_pci_del_card is later called, it may get freed again.  So that
entry is reset to NULL after the free.

Finally, if there is a problem with one channel, there will be a hole in the
array.  card->channels counts the number of channels that have succeeded,
and does not keep track of the index of the largest element in the array
that is valid.  So the loop in plx_pci_del_card is changed to go up to
PLX_PCI_MAX_CHAN, which is only 2.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-08-13 18:00:32 -07:00
..
c_can can: c_can: remove duplicated #include 2011-07-23 20:01:15 -07:00
mscan drivercore: revert addition of of_match to struct device 2011-05-18 12:32:23 -06:00
sja1000 drivers/net/can/sja1000/plx_pci.c: eliminate double free 2011-08-13 18:00:32 -07:00
softing Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-07-25 13:56:39 -07:00
usb Fix common misspellings 2011-03-31 11:26:23 -03:00
Kconfig Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2011-07-05 23:23:37 -07:00
Makefile can: c_can: Added support for Bosch C_CAN controller 2011-02-13 22:51:44 -08:00
at91_can.c can: at91_can: add support for the AT91SAM9X5 SOCs 2011-06-06 14:50:57 +02:00
bfin_can.c can: bfin_can: auto-calculate accessor sizes 2011-06-27 20:42:24 -07:00
dev.c can: make function can_get_bittiming static 2011-07-21 20:39:47 -07:00
flexcan.c drivers/net/can/flexcan.c: add missing clk_put 2011-06-02 00:10:01 -07:00
janz-ican3.c net: remove mm.h inclusion from netdevice.h 2011-06-21 19:17:20 -07:00
mcp251x.c can: mcp251x: Allow pass IRQ flags through platform data. 2011-04-06 12:24:26 -07:00
pch_can.c treewide: fix a few typos in comments 2011-05-10 10:16:21 +02:00
slcan.c slcan: ldisc generated skbs are received in softirq context 2011-08-11 05:52:57 -07:00
ti_hecc.c Fix common misspellings 2011-03-31 11:26:23 -03:00
vcan.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00