.. | .. |
---|
289 | 289 | |
---|
290 | 290 | virt = ioremap(link->resource[2]->start, |
---|
291 | 291 | resource_size(link->resource[2])); |
---|
| 292 | + if (unlikely(!virt)) { |
---|
| 293 | + pcmcia_release_window(link, link->resource[2]); |
---|
| 294 | + return NULL; |
---|
| 295 | + } |
---|
| 296 | + |
---|
292 | 297 | for (i = 0; i < NR_INFO; i++) { |
---|
293 | 298 | pcmcia_map_mem_page(link, link->resource[2], |
---|
294 | 299 | hw_info[i].offset & ~(resource_size(link->resource[2])-1)); |
---|
.. | .. |
---|
1103 | 1108 | switch (cmd) { |
---|
1104 | 1109 | case SIOCGMIIPHY: |
---|
1105 | 1110 | data->phy_id = info->phy_id; |
---|
1106 | | - /* fall through */ |
---|
| 1111 | + fallthrough; |
---|
1107 | 1112 | case SIOCGMIIREG: /* Read MII PHY register. */ |
---|
1108 | 1113 | data->val_out = mdio_read(mii_addr, data->phy_id, data->reg_num & 0x1f); |
---|
1109 | 1114 | return 0; |
---|
.. | .. |
---|
1173 | 1178 | outb_p(E8390_RREAD+E8390_START, nic_base + PCNET_CMD); |
---|
1174 | 1179 | |
---|
1175 | 1180 | insw(nic_base + PCNET_DATAPORT,buf,count>>1); |
---|
1176 | | - if (count & 0x01) |
---|
1177 | | - buf[count-1] = inb(nic_base + PCNET_DATAPORT), xfer_count++; |
---|
| 1181 | + if (count & 0x01) { |
---|
| 1182 | + buf[count-1] = inb(nic_base + PCNET_DATAPORT); |
---|
| 1183 | + xfer_count++; |
---|
| 1184 | + } |
---|
1178 | 1185 | |
---|
1179 | 1186 | /* This was for the ALPHA version only, but enough people have been |
---|
1180 | 1187 | encountering problems that it is still here. */ |
---|
.. | .. |
---|
1423 | 1430 | /* Try scribbling on the buffer */ |
---|
1424 | 1431 | info->base = ioremap(link->resource[3]->start, |
---|
1425 | 1432 | resource_size(link->resource[3])); |
---|
| 1433 | + if (unlikely(!info->base)) { |
---|
| 1434 | + ret = -ENOMEM; |
---|
| 1435 | + goto failed; |
---|
| 1436 | + } |
---|
| 1437 | + |
---|
1426 | 1438 | for (i = 0; i < (TX_PAGES<<8); i += 2) |
---|
1427 | 1439 | __raw_writew((i>>1), info->base+offset+i); |
---|
1428 | 1440 | udelay(100); |
---|