diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2014-09-19 06:56:56 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2014-09-19 11:12:00 -0400 |
commit | 7fbbd05799976c0611dcb229649260504b2bdef5 (patch) | |
tree | eaea35d81c4cfcd467d8086da62ab3e099edbe44 | |
parent | adfe83be973dc990f3763de3667c4cd004e6e4f7 (diff) |
UBI: return on error in rename_volumes()
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>
-rw-r--r-- | drivers/mtd/ubi/cdev.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 20aeb277d8d4..59de69a24e40 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c | |||
@@ -701,7 +701,7 @@ static int rename_volumes(struct ubi_device *ubi, | |||
701 | req->ents[i].name[req->ents[i].name_len] = '\0'; | 701 | req->ents[i].name[req->ents[i].name_len] = '\0'; |
702 | n = strlen(req->ents[i].name); | 702 | n = strlen(req->ents[i].name); |
703 | if (n != req->ents[i].name_len) | 703 | if (n != req->ents[i].name_len) |
704 | err = -EINVAL; | 704 | return -EINVAL; |
705 | } | 705 | } |
706 | 706 | ||
707 | /* Make sure volume IDs and names are unique */ | 707 | /* Make sure volume IDs and names are unique */ |