Skip to content

Commit

Permalink
UBI: return on error in rename_volumes()
Browse files Browse the repository at this point in the history
I noticed this during a code review.  We are checking that the strlen()
of ->name is not less than the ->name_len which the user gave us.  I
believe this bug is harmless but clearly we meant to return here instead
of setting an error code and then not using it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Dan Carpenter authored and Artem Bityutskiy committed Sep 19, 2014
1 parent adfe83b commit 7fbbd05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/ubi/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ static int rename_volumes(struct ubi_device *ubi,
req->ents[i].name[req->ents[i].name_len] = '\0';
n = strlen(req->ents[i].name);
if (n != req->ents[i].name_len)
err = -EINVAL;
return -EINVAL;
}

/* Make sure volume IDs and names are unique */
Expand Down

0 comments on commit 7fbbd05

Please sign in to comment.