Thread (10 messages) read the whole thread 10 messages, 2 authors, 2015-07-31

Re: [PATCH v2 5/5] mtd: ofpart: move ofpart partitions to a dedicated dt node

From: Boris Brezillon <hidden>
Date: 2015-07-31 17:25:08
Also in: lkml

On Fri, 31 Jul 2015 18:52:01 +0200
Michal Suchanek [off-list ref] wrote:

quoted
quoted
              (*pparts)[i].offset = of_read_number(reg, a_cells);
              (*pparts)[i].size = of_read_number(reg + a_cells, s_cells);
@@ -92,15 +116,15 @@ static int parse_ofpart_partitions(struct mtd_info *master,
              i++;
      }

-     if (!i) {
-             of_node_put(pp);
-             pr_err("No valid partition found on %s\n", node->full_name);
-             kfree(*pparts);
-             *pparts = NULL;
-             return -EINVAL;
-     }
-
Are you sure you can safely remove this check?
Yes. It was incomplete check to reject some partitioning schemes
considered invalid.

Now there is stricter checking above so this can be removed.
Indeed, I was worried about resources deallocation, but this is handle
by the caller, and if nr_parts is zero the master MTD device will
be exposed.




-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help