I'm not even sure we are even using this 'ubi' tool anywhere.
Fix the resource leak reported by Coverity anyway.
Coverity CID:
1330289 Resource leak
Coverity CID:
1330290 Resource leak
Coverity CID:
1330291 Resource leak
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
err = ubidetach(libubi, mtd);
if (err) {
ULOG_ERR("cannot detach \"%s\"", mtd);
err = ubidetach(libubi, mtd);
if (err) {
ULOG_ERR("cannot detach \"%s\"", mtd);
err = mtd_find("rootfs_ubi", mtd);
if (err) {
ULOG_ERR("MTD partition '%s_ubi' not found\n", partition);
err = mtd_find("rootfs_ubi", mtd);
if (err) {
ULOG_ERR("MTD partition '%s_ubi' not found\n", partition);
err = ubi_find(libubi, "rootfs_ubi", node);
if (err) {
ULOG_ERR("UBI volume '%s' not found\n", partition);
err = ubi_find(libubi, "rootfs_ubi", node);
if (err) {
ULOG_ERR("UBI volume '%s' not found\n", partition);
return -1;
}
err = ubidetach(libubi, mtd);
if (err) {
ULOG_ERR("cannot detach \"%s\"", mtd);
return -1;
}
err = ubidetach(libubi, mtd);
if (err) {
ULOG_ERR("cannot detach \"%s\"", mtd);
return -1;
}
err = ubiattach(libubi, mtd);
if (err) {
ULOG_ERR("cannot attach \"%s\"", mtd);
return -1;
}
err = ubiattach(libubi, mtd);
if (err) {
ULOG_ERR("cannot attach \"%s\"", mtd);
err = ubirmvol(libubi, node, overlay);
if (err) {
ULOG_ERR("cannot remove \"%s\"", node);
err = ubirmvol(libubi, node, overlay);
if (err) {
ULOG_ERR("cannot remove \"%s\"", node);
return -1;
}
}
if (volume_find(libubi, partition, volume) < 0) {
ULOG_ERR("UBI volume '%s' not found\n", partition);
return -1;
}
}
if (volume_find(libubi, partition, volume) < 0) {
ULOG_ERR("UBI volume '%s' not found\n", partition);
return -1;
}
err = ubirsvol(libubi, node, partition, s.st_size);
if (err) {
ULOG_ERR("cannot resize \"%s\"", partition);
return -1;
}
err = ubirsvol(libubi, node, partition, s.st_size);
if (err) {
ULOG_ERR("cannot resize \"%s\"", partition);
return -1;
}
err = ubiupdatevol(libubi, volume, image);
if (err) {
ULOG_ERR("cannot update \"%s\"", volume);
return -1;
}
err = ubiupdatevol(libubi, volume, image);
if (err) {
ULOG_ERR("cannot update \"%s\"", volume);
err = ubimkvol(libubi, node, overlay, 1);
if (err) {
ULOG_ERR("cannot make \"%s\"", overlay);
err = ubimkvol(libubi, node, overlay, 1);
if (err) {
ULOG_ERR("cannot make \"%s\"", overlay);
if (ubi_get_info(libubi, &info)) {
ULOG_ERR("failed to get info\n");
if (ubi_get_info(libubi, &info)) {
ULOG_ERR("failed to get info\n");