Commit 40543b3
ice: Add check for kzalloc
Add the check for the return value of kzalloc in order to avoid
NULL pointer dereference.
Moreover, use the goto-label to share the clean code.
Fixes: d6b98c8 ("ice: add write functionality for GNSS TTY")
Signed-off-by: Jiasheng Jiang <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
Tested-by: Gurucharan G <[email protected]> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <[email protected]>1 parent f589856 commit 40543b3
1 file changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
464 | 467 | | |
465 | 468 | | |
466 | 469 | | |
| |||
470 | 473 | | |
471 | 474 | | |
472 | 475 | | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
| 476 | + | |
482 | 477 | | |
483 | 478 | | |
484 | 479 | | |
485 | 480 | | |
486 | 481 | | |
487 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
488 | 493 | | |
489 | 494 | | |
490 | 495 | | |
| |||
0 commit comments