mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
UBI: remove unneeded error checks
Pointed to by viro. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
parent
2db61c95c0
commit
503990ebb2
2 changed files with 2 additions and 13 deletions
|
@ -685,13 +685,6 @@ static int __init ubi_init(void)
|
||||||
struct mtd_dev_param *p = &mtd_dev_param[i];
|
struct mtd_dev_param *p = &mtd_dev_param[i];
|
||||||
|
|
||||||
cond_resched();
|
cond_resched();
|
||||||
|
|
||||||
if (!p->name) {
|
|
||||||
dbg_err("empty name");
|
|
||||||
err = -EINVAL;
|
|
||||||
goto out_detach;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = attach_mtd_dev(p->name, p->vid_hdr_offs, p->data_offs);
|
err = attach_mtd_dev(p->name, p->vid_hdr_offs, p->data_offs);
|
||||||
if (err)
|
if (err)
|
||||||
goto out_detach;
|
goto out_detach;
|
||||||
|
@ -798,7 +791,7 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
|
||||||
|
|
||||||
/* Get rid of the final newline */
|
/* Get rid of the final newline */
|
||||||
if (buf[len - 1] == '\n')
|
if (buf[len - 1] == '\n')
|
||||||
buf[len - 1] = 0;
|
buf[len - 1] = '\0';
|
||||||
|
|
||||||
for (i = 0; i < 3; i++)
|
for (i = 0; i < 3; i++)
|
||||||
tokens[i] = strsep(&pbuf, ",");
|
tokens[i] = strsep(&pbuf, ",");
|
||||||
|
@ -808,9 +801,6 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tokens[0] == '\0')
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
p = &mtd_dev_param[mtd_devs];
|
p = &mtd_dev_param[mtd_devs];
|
||||||
strcpy(&p->name[0], tokens[0]);
|
strcpy(&p->name[0], tokens[0]);
|
||||||
|
|
||||||
|
|
|
@ -38,9 +38,8 @@ int ubi_get_device_info(int ubi_num, struct ubi_device_info *di)
|
||||||
const struct ubi_device *ubi;
|
const struct ubi_device *ubi;
|
||||||
|
|
||||||
if (ubi_num < 0 || ubi_num >= UBI_MAX_DEVICES ||
|
if (ubi_num < 0 || ubi_num >= UBI_MAX_DEVICES ||
|
||||||
!ubi_devices[ubi_num]) {
|
!ubi_devices[ubi_num])
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
|
||||||
|
|
||||||
ubi = ubi_devices[ubi_num];
|
ubi = ubi_devices[ubi_num];
|
||||||
di->ubi_num = ubi->ubi_num;
|
di->ubi_num = ubi->ubi_num;
|
||||||
|
|
Loading…
Reference in a new issue