Skip to content

Commit 061e86d

Browse files
committed
map: remove misleading error message when creating without BTF
Time and time again people misunderstand errors like the following: map create: cannot allocate memory (without BTF k/v) Instead of focusing on the ENOMEM they assume that it has something to do with BTF. In reality it just means that creating a map has failed, and we didn't supply any BTF during creation. Avoid this confusion by removing the "without BTF k/v" part. Signed-off-by: Lorenz Bauer <[email protected]>
1 parent b689d28 commit 061e86d

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

map.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,6 @@ func handleMapCreateError(attr sys.MapCreateAttr, spec *MapSpec, err error) erro
513513
return fmt.Errorf("map create: %w (ring map size %d not a multiple of page size %d)", err, maxEntries, pageSize)
514514
}
515515
}
516-
if attr.BtfFd == 0 {
517-
return fmt.Errorf("map create: %w (without BTF k/v)", err)
518-
}
519516

520517
return fmt.Errorf("map create: %w", err)
521518
}

0 commit comments

Comments
 (0)