diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-02-12 09:51:48 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-02-12 09:59:56 +0100 |
commit | 9d304e4c843b90804a05fac644ac5fa2d0638e8b (patch) | |
tree | 7cf6fb62c91015dd70319416b7108112e6e99cf2 /arch/sandbox | |
parent | e5123f5bd241964743eac5e69bc3defd67c01a0e (diff) | |
download | barebox-9d304e4c843b90804a05fac644ac5fa2d0638e8b.tar.gz barebox-9d304e4c843b90804a05fac644ac5fa2d0638e8b.tar.xz |
sandbox: fix unreliable block device detection
If barebox detects that an --image file is a block device, it will try
to represent it as a block device internally as well, provided that
the user didn't explicitly specify that it should be mapped as a
character device instead. The hf_info::is_cdev member used to indicate
this override wasn't initialized though, so detection was unreliable,
Fix this.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox')
-rw-r--r-- | arch/sandbox/os/common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c index da87be29c7..56c2d05193 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -276,7 +276,7 @@ extern char * strsep_unescaped(char **s, const char *ct); static int add_image(const char *_str, char *devname_template, int *devname_number) { - struct hf_info *hf = malloc(sizeof(struct hf_info)); + struct hf_info *hf = calloc(1, sizeof(struct hf_info)); char *str, *filename, *devname; char tmp[16]; char *opt; |