Repository navigation
Commit 73f38fe
drivers/macintosh/smu.c: Improve error handling
This makes two changes:
* As noted by Akinobu Mita in patch
b1fceac, alloc_bootmem never returns NULL
and always returns a zeroed region of memory. Thus the error checking code
and memset after the call to alloc_bootmem are not necessary.
* The old error handling code consisted of setting a global variable to
NULL and returning an error code, which could cause previously allocated
resources never to be freed. The patch adds calls to appropriate resource
deallocation functions.
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Paul Mackerras <paulus@samba.org>1 parent 178f8d7 commit 73f38fe
1 file changed
Lines changed: 19 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| 477 | + | |
477 | 478 | | |
478 | 479 | | |
479 | 480 | | |
| |||
483 | 484 | | |
484 | 485 | | |
485 | 486 | | |
486 | | - | |
487 | | - | |
| 487 | + | |
| 488 | + | |
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | 492 | | |
497 | 493 | | |
498 | 494 | | |
| |||
510 | 506 | | |
511 | 507 | | |
512 | 508 | | |
513 | | - | |
| 509 | + | |
| 510 | + | |
514 | 511 | | |
515 | 512 | | |
516 | 513 | | |
517 | | - | |
518 | | - | |
519 | 514 | | |
520 | | - | |
| 515 | + | |
| 516 | + | |
521 | 517 | | |
522 | 518 | | |
523 | 519 | | |
| |||
551 | 547 | | |
552 | 548 | | |
553 | 549 | | |
554 | | - | |
| 550 | + | |
| 551 | + | |
555 | 552 | | |
556 | 553 | | |
557 | 554 | | |
| |||
562 | 559 | | |
563 | 560 | | |
564 | 561 | | |
565 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
566 | 569 | | |
567 | | - | |
568 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
569 | 573 | | |
570 | 574 | | |
571 | 575 | | |
| |||
0 commit comments