Details
-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
Lustre 2.5.0
-
3
-
10902
Description
An error path in ofd_precreate_objects() applies PTR_ERR() to a NULL pointer.
struct ofd_object *fo = NULL;
...
/* prepare objects */
ostid_set_seq(&info->fti_ostid, ostid_seq(&oseq->os_oi));
for (i = 0; i < nr; i++) {
ostid_set_id(&info->fti_ostid, id + i);
rc = ostid_to_fid(&info->fti_fid, &info->fti_ostid, 0);
if (rc) {
if (i == 0)
GOTO(out, rc = PTR_ERR(fo));
nr = i;
break;
}
fo = ofd_object_find(env, ofd, &info->fti_fid);
if (IS_ERR(fo)) {
if (i == 0)
GOTO(out, rc = PTR_ERR(fo));
nr = i;
break;
}
The first GOTO statement should be GOTO(out, rc). This was found using a script from the coccinelle examples directory.