Skip to content
Snippets Groups Projects
Commit 7e71dc68 authored by Tim Kientzle's avatar Tim Kientzle Committed by Anatolij Gustschin
Browse files

disk/part.c: Fix device enumeration through API


The patch below fixes device enumeration through the U-Boot API.

Device enumeration crashes when the system in question doesn't
have any RAM mapped to address zero (I discovered this on a
BeagleBone board), since the enumeration calls get_dev with a
NULL ifname sometimes which then gets passed down to strncmp().

This fix simply ensures that get_dev returns NULL when invoked
with a NULL ifname.

Signed-off-by: default avatarTim Kientzle <kientzle@freebsd.org>
Signed-off-by: default avatarAnatolij Gustschin <agust@denx.de>
parent d8d26599
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,9 @@ block_dev_desc_t *get_dev(char* ifname, int dev)
block_dev_desc_t* (*reloc_get_dev)(int dev);
char *name;
if (!ifname)
return NULL;
name = drvr->name;
#ifdef CONFIG_NEEDS_MANUAL_RELOC
name += gd->reloc_off;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment