diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-11 19:32:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-11 19:32:41 -0500 |
commit | 4162cf64973df51fc885825bc9ca4d055891c49f (patch) | |
tree | f218c7bd298f4d41be94d08a314eb9fbc3fcb4ea /drivers/atm | |
parent | fb7b5a956992fdc53d0b9c8ea29b51b92839dc1b (diff) | |
parent | 343a8d13aae58dec562dbb5c7d48a53e9b847871 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (67 commits)
cxgb4vf: recover from failure in cxgb4vf_open()
netfilter: ebtables: make broute table work again
netfilter: fix race in conntrack between dump_table and destroy
ah: reload pointers to skb data after calling skb_cow_data()
ah: update maximum truncated ICV length
xfrm: check trunc_len in XFRMA_ALG_AUTH_TRUNC
ehea: Increase the skb array usage
net/fec: remove config FEC2 as it's used nowhere
pcnet_cs: add new_id
tcp: disallow bind() to reuse addr/port
net/r8169: Update the function of parsing firmware
net: ppp: use {get,put}_unaligned_be{16,32}
CAIF: Fix IPv6 support in receive path for GPRS/3G
arp: allow to invalidate specific ARP entries
net_sched: factorize qdisc stats handling
mlx4: Call alloc_etherdev to allocate RX and TX queues
net: Add alloc_netdev_mqs function
caif: don't set connection request param size before copying data
cxgb4vf: fix mailbox data/control coherency domain race
qlcnic: change module parameter permissions
...
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/ambassador.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index ffe9b655292e..9f47e8625266 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c | |||
@@ -1926,8 +1926,9 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) { | |||
1926 | const struct firmware *fw; | 1926 | const struct firmware *fw; |
1927 | unsigned long start_address; | 1927 | unsigned long start_address; |
1928 | const struct ihex_binrec *rec; | 1928 | const struct ihex_binrec *rec; |
1929 | const char *errmsg = 0; | ||
1929 | int res; | 1930 | int res; |
1930 | 1931 | ||
1931 | res = request_ihex_firmware(&fw, "atmsar11.fw", &dev->pci_dev->dev); | 1932 | res = request_ihex_firmware(&fw, "atmsar11.fw", &dev->pci_dev->dev); |
1932 | if (res) { | 1933 | if (res) { |
1933 | PRINTK (KERN_ERR, "Cannot load microcode data"); | 1934 | PRINTK (KERN_ERR, "Cannot load microcode data"); |
@@ -1937,8 +1938,8 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) { | |||
1937 | /* First record contains just the start address */ | 1938 | /* First record contains just the start address */ |
1938 | rec = (const struct ihex_binrec *)fw->data; | 1939 | rec = (const struct ihex_binrec *)fw->data; |
1939 | if (be16_to_cpu(rec->len) != sizeof(__be32) || be32_to_cpu(rec->addr)) { | 1940 | if (be16_to_cpu(rec->len) != sizeof(__be32) || be32_to_cpu(rec->addr)) { |
1940 | PRINTK (KERN_ERR, "Bad microcode data (no start record)"); | 1941 | errmsg = "no start record"; |
1941 | return -EINVAL; | 1942 | goto fail; |
1942 | } | 1943 | } |
1943 | start_address = be32_to_cpup((__be32 *)rec->data); | 1944 | start_address = be32_to_cpup((__be32 *)rec->data); |
1944 | 1945 | ||
@@ -1950,12 +1951,12 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) { | |||
1950 | PRINTD (DBG_LOAD, "starting region (%x, %u)", be32_to_cpu(rec->addr), | 1951 | PRINTD (DBG_LOAD, "starting region (%x, %u)", be32_to_cpu(rec->addr), |
1951 | be16_to_cpu(rec->len)); | 1952 | be16_to_cpu(rec->len)); |
1952 | if (be16_to_cpu(rec->len) > 4 * MAX_TRANSFER_DATA) { | 1953 | if (be16_to_cpu(rec->len) > 4 * MAX_TRANSFER_DATA) { |
1953 | PRINTK (KERN_ERR, "Bad microcode data (record too long)"); | 1954 | errmsg = "record too long"; |
1954 | return -EINVAL; | 1955 | goto fail; |
1955 | } | 1956 | } |
1956 | if (be16_to_cpu(rec->len) & 3) { | 1957 | if (be16_to_cpu(rec->len) & 3) { |
1957 | PRINTK (KERN_ERR, "Bad microcode data (odd number of bytes)"); | 1958 | errmsg = "odd number of bytes"; |
1958 | return -EINVAL; | 1959 | goto fail; |
1959 | } | 1960 | } |
1960 | res = loader_write(lb, dev, rec); | 1961 | res = loader_write(lb, dev, rec); |
1961 | if (res) | 1962 | if (res) |
@@ -1970,6 +1971,10 @@ static int __devinit ucode_init (loader_block * lb, amb_dev * dev) { | |||
1970 | res = loader_start(lb, dev, start_address); | 1971 | res = loader_start(lb, dev, start_address); |
1971 | 1972 | ||
1972 | return res; | 1973 | return res; |
1974 | fail: | ||
1975 | release_firmware(fw); | ||
1976 | PRINTK(KERN_ERR, "Bad microcode data (%s)", errmsg); | ||
1977 | return -EINVAL; | ||
1973 | } | 1978 | } |
1974 | 1979 | ||
1975 | /********** give adapter parameters **********/ | 1980 | /********** give adapter parameters **********/ |