mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-29 14:41:26 +01:00
expo: allocate correct amount of memory
This should be allocating the memory for "item" instead of "menu". The item struct is 48 bytes instead of 96 (assuming a 64bit system) so this saves a little memory. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
0c0d471e2b
commit
d864bd0e21
@ -416,7 +416,7 @@ int scene_menuitem(struct scene *scn, uint menu_id, const char *name, uint id,
|
|||||||
if (!scene_obj_find(scn, label_id, SCENEOBJT_TEXT))
|
if (!scene_obj_find(scn, label_id, SCENEOBJT_TEXT))
|
||||||
return log_msg_ret("txt", -EINVAL);
|
return log_msg_ret("txt", -EINVAL);
|
||||||
|
|
||||||
item = calloc(1, sizeof(struct scene_obj_menu));
|
item = calloc(1, sizeof(struct scene_menitem));
|
||||||
if (!item)
|
if (!item)
|
||||||
return log_msg_ret("item", -ENOMEM);
|
return log_msg_ret("item", -ENOMEM);
|
||||||
item->name = strdup(name);
|
item->name = strdup(name);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user