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.

Merge tag 'for-linus-20130509' of git://git.infradead.org/~dwmw2/random-2.6

Pull misc fixes from David Woodhouse:
"This is some miscellaneous cleanups that don't really belong anywhere
else (or were ignored), that have been sitting in linux-next for some
time. Two of them are fixes resulting from my audit of krealloc()
usage that don't seem to have elicited any response when I posted
them, and the other three are patches from Artem removing dead code."

* tag 'for-linus-20130509' of git://git.infradead.org/~dwmw2/random-2.6:
pcmcia: remove RPX board stuff
m68k: remove rpxlite stuff
pcmcia: remove Motorola MBX860 support
params: Fix potential memory leak in add_sysfs_param()
dell-laptop: Fix krealloc() misuse in parse_da_table()

+10 -162
-17
arch/m68k/include/asm/commproc.h
··· 480 480 #define SICR_ENET_CLKRT ((uint)0x0000003d) 481 481 #endif 482 482 483 - #ifdef CONFIG_RPXLITE 484 - /* This ENET stuff is for the MPC850 with ethernet on SCC2. Some of 485 - * this may be unique to the RPX-Lite configuration. 486 - * Note TENA is on Port B. 487 - */ 488 - #define PA_ENET_RXD ((ushort)0x0004) 489 - #define PA_ENET_TXD ((ushort)0x0008) 490 - #define PA_ENET_TCLK ((ushort)0x0200) 491 - #define PA_ENET_RCLK ((ushort)0x0800) 492 - #define PB_ENET_TENA ((uint)0x00002000) 493 - #define PC_ENET_CLSN ((ushort)0x0040) 494 - #define PC_ENET_RENA ((ushort)0x0080) 495 - 496 - #define SICR_ENET_MASK ((uint)0x0000ff00) 497 - #define SICR_ENET_CLKRT ((uint)0x00003d00) 498 - #endif 499 - 500 483 #ifdef CONFIG_BSEIP 501 484 /* This ENET stuff is for the MPC823 with ethernet on SCC2. 502 485 * This is unique to the BSE ip-Engine board.
-140
drivers/pcmcia/m8xx_pcmcia.c
··· 68 68 69 69 #if !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B) 70 70 71 - /* The RPX series use SLOT_B */ 72 - #if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPXLITE) 73 - #define CONFIG_PCMCIA_SLOT_B 74 - #define CONFIG_BD_IS_MHZ 75 - #endif 76 - 77 71 /* The ADS board use SLOT_A */ 78 72 #ifdef CONFIG_ADS 79 73 #define CONFIG_PCMCIA_SLOT_A ··· 247 253 248 254 #define PCMCIA_BMT_LIMIT (15*4) /* Bus Monitor Timeout value */ 249 255 250 - /* ------------------------------------------------------------------------- */ 251 - /* board specific stuff: */ 252 - /* voltage_set(), hardware_enable() and hardware_disable() */ 253 - /* ------------------------------------------------------------------------- */ 254 - /* RPX Boards from Embedded Planet */ 255 - 256 - #if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPXLITE) 257 - 258 - /* The RPX boards seems to have it's bus monitor timeout set to 6*8 clocks. 259 - * SYPCR is write once only, therefore must the slowest memory be faster 260 - * than the bus monitor or we will get a machine check due to the bus timeout. 261 - */ 262 - 263 - #define PCMCIA_BOARD_MSG "RPX CLASSIC or RPX LITE" 264 - 265 - #undef PCMCIA_BMT_LIMIT 266 - #define PCMCIA_BMT_LIMIT (6*8) 267 - 268 - static int voltage_set(int slot, int vcc, int vpp) 269 - { 270 - u32 reg = 0; 271 - 272 - switch (vcc) { 273 - case 0: 274 - break; 275 - case 33: 276 - reg |= BCSR1_PCVCTL4; 277 - break; 278 - case 50: 279 - reg |= BCSR1_PCVCTL5; 280 - break; 281 - default: 282 - return 1; 283 - } 284 - 285 - switch (vpp) { 286 - case 0: 287 - break; 288 - case 33: 289 - case 50: 290 - if (vcc == vpp) 291 - reg |= BCSR1_PCVCTL6; 292 - else 293 - return 1; 294 - break; 295 - case 120: 296 - reg |= BCSR1_PCVCTL7; 297 - default: 298 - return 1; 299 - } 300 - 301 - if (!((vcc == 50) || (vcc == 0))) 302 - return 1; 303 - 304 - /* first, turn off all power */ 305 - 306 - out_be32(((u32 *) RPX_CSR_ADDR), 307 - in_be32(((u32 *) RPX_CSR_ADDR)) & ~(BCSR1_PCVCTL4 | 308 - BCSR1_PCVCTL5 | 309 - BCSR1_PCVCTL6 | 310 - BCSR1_PCVCTL7)); 311 - 312 - /* enable new powersettings */ 313 - 314 - out_be32(((u32 *) RPX_CSR_ADDR), in_be32(((u32 *) RPX_CSR_ADDR)) | reg); 315 - 316 - return 0; 317 - } 318 - 319 - #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V 320 - #define hardware_enable(_slot_) /* No hardware to enable */ 321 - #define hardware_disable(_slot_) /* No hardware to disable */ 322 - 323 - #endif /* CONFIG_RPXCLASSIC */ 324 - 325 256 /* FADS Boards from Motorola */ 326 257 327 258 #if defined(CONFIG_FADS) ··· 337 418 } 338 419 339 420 #endif 340 - 341 - /* ------------------------------------------------------------------------- */ 342 - /* Motorola MBX860 */ 343 - 344 - #if defined(CONFIG_MBX) 345 - 346 - #define PCMCIA_BOARD_MSG "MBX" 347 - 348 - static int voltage_set(int slot, int vcc, int vpp) 349 - { 350 - u8 reg = 0; 351 - 352 - switch (vcc) { 353 - case 0: 354 - break; 355 - case 33: 356 - reg |= CSR2_VCC_33; 357 - break; 358 - case 50: 359 - reg |= CSR2_VCC_50; 360 - break; 361 - default: 362 - return 1; 363 - } 364 - 365 - switch (vpp) { 366 - case 0: 367 - break; 368 - case 33: 369 - case 50: 370 - if (vcc == vpp) 371 - reg |= CSR2_VPP_VCC; 372 - else 373 - return 1; 374 - break; 375 - case 120: 376 - if ((vcc == 33) || (vcc == 50)) 377 - reg |= CSR2_VPP_12; 378 - else 379 - return 1; 380 - default: 381 - return 1; 382 - } 383 - 384 - /* first, turn off all power */ 385 - out_8((u8 *) MBX_CSR2_ADDR, 386 - in_8((u8 *) MBX_CSR2_ADDR) & ~(CSR2_VCC_MASK | CSR2_VPP_MASK)); 387 - 388 - /* enable new powersettings */ 389 - out_8((u8 *) MBX_CSR2_ADDR, in_8((u8 *) MBX_CSR2_ADDR) | reg); 390 - 391 - return 0; 392 - } 393 - 394 - #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V 395 - #define hardware_enable(_slot_) /* No hardware to enable */ 396 - #define hardware_disable(_slot_) /* No hardware to disable */ 397 - 398 - #endif /* CONFIG_MBX */ 399 421 400 422 #if defined(CONFIG_PRxK) 401 423 #include <asm/cpld.h>
+6 -4
drivers/platform/x86/dell-laptop.c
··· 284 284 { 285 285 /* Final token is a terminator, so we don't want to copy it */ 286 286 int tokens = (dm->length-11)/sizeof(struct calling_interface_token)-1; 287 + struct calling_interface_token *new_da_tokens; 287 288 struct calling_interface_structure *table = 288 289 container_of(dm, struct calling_interface_structure, header); 289 290 ··· 297 296 da_command_address = table->cmdIOAddress; 298 297 da_command_code = table->cmdIOCode; 299 298 300 - da_tokens = krealloc(da_tokens, (da_num_tokens + tokens) * 301 - sizeof(struct calling_interface_token), 302 - GFP_KERNEL); 299 + new_da_tokens = krealloc(da_tokens, (da_num_tokens + tokens) * 300 + sizeof(struct calling_interface_token), 301 + GFP_KERNEL); 303 302 304 - if (!da_tokens) 303 + if (!new_da_tokens) 305 304 return; 305 + da_tokens = new_da_tokens; 306 306 307 307 memcpy(da_tokens+da_num_tokens, table->tokens, 308 308 sizeof(struct calling_interface_token) * tokens);
+4 -1
kernel/params.c
··· 613 613 sizeof(*mk->mp) + sizeof(mk->mp->attrs[0]) * (num+1), 614 614 GFP_KERNEL); 615 615 if (!new) { 616 - kfree(mk->mp); 616 + kfree(attrs); 617 617 err = -ENOMEM; 618 618 goto fail; 619 619 } 620 + /* Despite looking like the typical realloc() bug, this is safe. 621 + * We *want* the old 'attrs' to be freed either way, and we'll store 622 + * the new one in the success case. */ 620 623 attrs = krealloc(attrs, sizeof(new->grp.attrs[0])*(num+2), GFP_KERNEL); 621 624 if (!attrs) { 622 625 err = -ENOMEM;