Commit 4bb7be9
kexec: copy only happens before uchunk goes to zero
When loading segments, ubytes is <= mbytes. When ubytes is exhausted,
there could be remaining mbytes. Then in the while loop, the buf pointer
advancing with mchunk will causing meaningless reading even though it
doesn't harm.
So let's change to make sure that all of the copying and the rest only
happens before uchunk goes to zero.
Link: https://lkml.kernel.org/r/20240222092119.5602-1-gaoshanliukou@163.com
Signed-off-by: yang.zhang <yang.zhang@hexintek.com>
Acked-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent a436184 commit 4bb7be9
1 file changed
Lines changed: 24 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
808 | 815 | | |
809 | 816 | | |
810 | 817 | | |
811 | 818 | | |
812 | 819 | | |
813 | | - | |
814 | 820 | | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | 821 | | |
820 | 822 | | |
821 | 823 | | |
| |||
866 | 868 | | |
867 | 869 | | |
868 | 870 | | |
869 | | - | |
870 | | - | |
871 | | - | |
872 | | - | |
873 | | - | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
874 | 883 | | |
875 | 884 | | |
876 | 885 | | |
877 | 886 | | |
878 | 887 | | |
879 | 888 | | |
880 | 889 | | |
881 | | - | |
882 | 890 | | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | 891 | | |
888 | 892 | | |
889 | 893 | | |
| |||
0 commit comments