linux_dsm_epyc7002/drivers/net/can/sja1000
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
..
ems_pci.c Fix some #includes in CAN drivers (rebased for net-next-2.6) 2010-04-13 03:32:42 -07:00
Kconfig can: tscan1: add driver for TS-CAN1 boards 2010-10-24 15:26:48 -07:00
kvaser_pci.c Fix some #includes in CAN drivers (rebased for net-next-2.6) 2010-04-13 03:32:42 -07:00
Makefile can: tscan1: add driver for TS-CAN1 boards 2010-10-24 15:26:48 -07:00
plx_pci.c drivers/net/can/sja1000/plx_pci.c: eliminate double free 2011-08-13 18:00:32 -07:00
sja1000_isa.c Fix some #includes in CAN drivers (rebased for net-next-2.6) 2010-04-13 03:32:42 -07:00
sja1000_of_platform.c net: include io.h in sja1000_of_platform.c for iounmap etc 2011-06-29 02:55:28 -07:00
sja1000_platform.c can: sja1000 platform data fixes 2010-05-17 22:39:48 -07:00
sja1000.c can: fix SJA1000 dlc for RTR packets 2011-05-05 11:02:22 -07:00
sja1000.h net: remove interrupt.h inclusion from netdevice.h 2011-06-06 22:55:11 -07:00
tscan1.c can: tscan1: add driver for TS-CAN1 boards 2010-10-24 15:26:48 -07:00