Skip to content

Commit

Permalink
lk2nd: boot: extlinux: Fix calloc warning
Browse files Browse the repository at this point in the history
lk2nd/boot/extlinux.c: In function 'parse_conf':
lk2nd/boot/extlinux.c:216:67: warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
  216 |                                 label->dtboverlays = calloc(sizeof(*label->dtboverlays), cnt);
      |                                                                   ^
lk2nd/boot/extlinux.c:216:67: note: earlier argument should specify number of elements, later size of each element
  • Loading branch information
TravMurav committed Jun 3, 2024
1 parent f8f837b commit 4427cf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lk2nd/boot/extlinux.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static int parse_conf(char *data, size_t size, struct label *label)

cnt += 2;

label->dtboverlays = calloc(sizeof(*label->dtboverlays), cnt);
label->dtboverlays = calloc(cnt, sizeof(*label->dtboverlays));
cnt = 0;
for (overlay = strtok_r(value, " ", &saveptr); overlay;
overlay = strtok_r(NULL, " ", &saveptr)) {
Expand Down

0 comments on commit 4427cf2

Please sign in to comment.