@@ -916,11 +916,14 @@ int tiler_map_show(struct seq_file *s, void *arg)
}
h_adj = omap_dmm->container_height / ydiv;
- w_adj = omap_dmm->container_width / xdiv;
map = kmalloc_array(h_adj, sizeof(*map), GFP_KERNEL);
+ if (!map)
+ return 0;
+
+ w_adj = omap_dmm->container_width / xdiv;
global_map = kmalloc_array(h_adj, w_adj + 1, GFP_KERNEL);
- if (!map || !global_map)
- goto error;
+ if (!global_map)
+ goto free_map;
for (lut_idx = 0; lut_idx < omap_dmm->num_lut; lut_idx++) {
memset(map, 0, h_adj * sizeof(*map));
@@ -982,10 +985,9 @@ int tiler_map_show(struct seq_file *s, void *arg)
}
}
-error:
- kfree(map);
kfree(global_map);
-
+ free_map:
+ kfree(map);
return 0;
}
#endif