diff options
Diffstat (limited to 'drivers/atm/firestream.c')
-rw-r--r-- | drivers/atm/firestream.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 38fc054bd671..5f25e5efefcd 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c | |||
@@ -1784,7 +1784,7 @@ static int __devinit fs_init (struct fs_dev *dev) | |||
1784 | write_fs (dev, RAM, (1 << (28 - FS155_VPI_BITS - FS155_VCI_BITS)) - 1); | 1784 | write_fs (dev, RAM, (1 << (28 - FS155_VPI_BITS - FS155_VCI_BITS)) - 1); |
1785 | dev->nchannels = FS155_NR_CHANNELS; | 1785 | dev->nchannels = FS155_NR_CHANNELS; |
1786 | } | 1786 | } |
1787 | dev->atm_vccs = kmalloc (dev->nchannels * sizeof (struct atm_vcc *), | 1787 | dev->atm_vccs = kcalloc (dev->nchannels, sizeof (struct atm_vcc *), |
1788 | GFP_KERNEL); | 1788 | GFP_KERNEL); |
1789 | fs_dprintk (FS_DEBUG_ALLOC, "Alloc atmvccs: %p(%Zd)\n", | 1789 | fs_dprintk (FS_DEBUG_ALLOC, "Alloc atmvccs: %p(%Zd)\n", |
1790 | dev->atm_vccs, dev->nchannels * sizeof (struct atm_vcc *)); | 1790 | dev->atm_vccs, dev->nchannels * sizeof (struct atm_vcc *)); |
@@ -1794,9 +1794,8 @@ static int __devinit fs_init (struct fs_dev *dev) | |||
1794 | /* XXX Clean up..... */ | 1794 | /* XXX Clean up..... */ |
1795 | return 1; | 1795 | return 1; |
1796 | } | 1796 | } |
1797 | memset (dev->atm_vccs, 0, dev->nchannels * sizeof (struct atm_vcc *)); | ||
1798 | 1797 | ||
1799 | dev->tx_inuse = kmalloc (dev->nchannels / 8 /* bits/byte */ , GFP_KERNEL); | 1798 | dev->tx_inuse = kzalloc (dev->nchannels / 8 /* bits/byte */ , GFP_KERNEL); |
1800 | fs_dprintk (FS_DEBUG_ALLOC, "Alloc tx_inuse: %p(%d)\n", | 1799 | fs_dprintk (FS_DEBUG_ALLOC, "Alloc tx_inuse: %p(%d)\n", |
1801 | dev->atm_vccs, dev->nchannels / 8); | 1800 | dev->atm_vccs, dev->nchannels / 8); |
1802 | 1801 | ||
@@ -1805,8 +1804,6 @@ static int __devinit fs_init (struct fs_dev *dev) | |||
1805 | /* XXX Clean up..... */ | 1804 | /* XXX Clean up..... */ |
1806 | return 1; | 1805 | return 1; |
1807 | } | 1806 | } |
1808 | memset (dev->tx_inuse, 0, dev->nchannels / 8); | ||
1809 | |||
1810 | /* -- RAS1 : FS155 and 50 differ. Default (0) should be OK for both */ | 1807 | /* -- RAS1 : FS155 and 50 differ. Default (0) should be OK for both */ |
1811 | /* -- RAS2 : FS50 only: Default is OK. */ | 1808 | /* -- RAS2 : FS50 only: Default is OK. */ |
1812 | 1809 | ||
@@ -1893,14 +1890,11 @@ static int __devinit firestream_init_one (struct pci_dev *pci_dev, | |||
1893 | if (pci_enable_device(pci_dev)) | 1890 | if (pci_enable_device(pci_dev)) |
1894 | goto err_out; | 1891 | goto err_out; |
1895 | 1892 | ||
1896 | fs_dev = kmalloc (sizeof (struct fs_dev), GFP_KERNEL); | 1893 | fs_dev = kzalloc (sizeof (struct fs_dev), GFP_KERNEL); |
1897 | fs_dprintk (FS_DEBUG_ALLOC, "Alloc fs-dev: %p(%Zd)\n", | 1894 | fs_dprintk (FS_DEBUG_ALLOC, "Alloc fs-dev: %p(%Zd)\n", |
1898 | fs_dev, sizeof (struct fs_dev)); | 1895 | fs_dev, sizeof (struct fs_dev)); |
1899 | if (!fs_dev) | 1896 | if (!fs_dev) |
1900 | goto err_out; | 1897 | goto err_out; |
1901 | |||
1902 | memset (fs_dev, 0, sizeof (struct fs_dev)); | ||
1903 | |||
1904 | atm_dev = atm_dev_register("fs", &ops, -1, NULL); | 1898 | atm_dev = atm_dev_register("fs", &ops, -1, NULL); |
1905 | if (!atm_dev) | 1899 | if (!atm_dev) |
1906 | goto err_out_free_fs_dev; | 1900 | goto err_out_free_fs_dev; |