int bus_number;
byte busmap[256];
- bzero(busmap, sizeof(busmap));
+ memset(busmap, 0, sizeof(busmap));
for (i = 0; i < pci_bus_count; i++)
{
bus_number = pci_buses[i].bus_number;
aix_read(struct pci_dev *d, int pos, byte *buf, int len)
{
struct mdio mdio;
- int fd = aix_bus_open(d->access, d->bus);
+ int fd;
+ if (pos + len > 256)
+ return 0;
+
+ fd = aix_bus_open(d->access, d->bus);
mdio.md_addr = (ulong) pos;
mdio.md_size = len;
mdio.md_incr = MV_BYTE;
if (ioctl(fd, MIOPCFGET, &mdio) < 0)
d->access->error("aix_read: ioctl(MIOPCFGET) failed");
-
+
return 1;
}
aix_write(struct pci_dev *d, int pos, byte *buf, int len)
{
struct mdio mdio;
- int fd = aix_bus_open(d->access, d->bus);
+ int fd;
+
+ if (pos + len > 256)
+ return 0;
+ fd = aix_bus_open(d->access, d->bus);
mdio.md_addr = (ulong) pos;
mdio.md_size = len;
mdio.md_incr = MV_BYTE;