|
|
@@ -2293,10 +2293,7 @@ int bpf_prog_load(const char *file, enum bpf_prog_type type,
|
|
|
int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr,
|
|
|
struct bpf_object **pobj, int *prog_fd)
|
|
|
{
|
|
|
- struct bpf_object_open_attr open_attr = {
|
|
|
- .file = attr->file,
|
|
|
- .prog_type = attr->prog_type,
|
|
|
- };
|
|
|
+ struct bpf_object_open_attr open_attr = {};
|
|
|
struct bpf_program *prog, *first_prog = NULL;
|
|
|
enum bpf_attach_type expected_attach_type;
|
|
|
enum bpf_prog_type prog_type;
|
|
|
@@ -2309,6 +2306,9 @@ int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr,
|
|
|
if (!attr->file)
|
|
|
return -EINVAL;
|
|
|
|
|
|
+ open_attr.file = attr->file;
|
|
|
+ open_attr.prog_type = attr->prog_type;
|
|
|
+
|
|
|
obj = bpf_object__open_xattr(&open_attr);
|
|
|
if (IS_ERR_OR_NULL(obj))
|
|
|
return -ENOENT;
|