Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

m68k: Some network drivers do not check the platform

Some network drivers do not check whether they're actually running on the
correct platform, causing multi-platform kernels to crash if they are not.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Geert Uytterhoeven and committed by
Linus Torvalds
0f734484 d6497700

+19
+7
drivers/net/82596.c
··· 1162 1162 memcpy(eth_addr, (void *) 0xfffc1f2c, 6); /* YUCK! Get addr from NOVRAM */ 1163 1163 dev->base_addr = MVME_I596_BASE; 1164 1164 dev->irq = (unsigned) MVME16x_IRQ_I596; 1165 + goto found; 1165 1166 } 1166 1167 #endif 1167 1168 #ifdef ENABLE_BVME6000_NET ··· 1177 1176 rtc[3] = msr; 1178 1177 dev->base_addr = BVME_I596_BASE; 1179 1178 dev->irq = (unsigned) BVME_IRQ_I596; 1179 + goto found; 1180 1180 } 1181 1181 #endif 1182 1182 #ifdef ENABLE_APRICOT ··· 1214 1212 } 1215 1213 1216 1214 dev->irq = 10; 1215 + goto found; 1217 1216 } 1218 1217 #endif 1218 + err = -ENODEV; 1219 + goto out; 1220 + 1221 + found: 1219 1222 dev->mem_start = (int)__get_free_pages(GFP_ATOMIC, 0); 1220 1223 if (!dev->mem_start) { 1221 1224 err = -ENOMEM;
+3
drivers/net/apne.c
··· 127 127 #endif 128 128 int err; 129 129 130 + if (!MACH_IS_AMIGA) 131 + return ERR_PTR(-ENODEV); 132 + 130 133 if (apne_owned) 131 134 return ERR_PTR(-ENODEV); 132 135
+3
drivers/net/mac89x0.c
··· 183 183 int err = -ENODEV; 184 184 DECLARE_MAC_BUF(mac); 185 185 186 + if (!MACH_IS_MAC) 187 + return ERR_PTR(-ENODEV); 188 + 186 189 dev = alloc_etherdev(sizeof(struct net_local)); 187 190 if (!dev) 188 191 return ERR_PTR(-ENOMEM);
+3
drivers/net/macmace.c
··· 781 781 { 782 782 int err; 783 783 784 + if (!MACH_IS_MAC) 785 + return -ENODEV; 786 + 784 787 if ((err = platform_driver_register(&mac_mace_driver))) { 785 788 printk(KERN_ERR "Driver registration failed\n"); 786 789 return err;
+3
drivers/net/sun3lance.c
··· 250 250 static int found; 251 251 int err = -ENODEV; 252 252 253 + if (!MACH_IS_SUN3 && !MACH_IS_SUN3X) 254 + return ERR_PTR(-ENODEV); 255 + 253 256 /* check that this machine has an onboard lance */ 254 257 switch(idprom->id_machtype) { 255 258 case SM_SUN3|SM_3_50: