Merge pull request #580 from marysaka/fix/bpf_create_map_panic

aya: Do not use unwrap with btf_fd in bpf_create_map
pull/582/head
Alessandro Decina 2 years ago committed by GitHub
commit edd9928314
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -66,7 +66,7 @@ pub(crate) fn bpf_create_map(name: &CStr, def: &obj::Map, btf_fd: Option<RawFd>)
_ => {
u.btf_key_type_id = m.def.btf_key_type_id;
u.btf_value_type_id = m.def.btf_value_type_id;
u.btf_fd = btf_fd.unwrap() as u32;
u.btf_fd = btf_fd.unwrap_or_default() as u32;
}
}
}

Loading…
Cancel
Save