diff mbox series

[1/2] util: Fix CID 314958

Message ID 20201224132312.156475-1-toertel@gmail.com
State Accepted
Headers show
Series [1/2] util: Fix CID 314958 | expand

Commit Message

Mark Jonas Dec. 24, 2020, 1:23 p.m. UTC
Recursive call of mkpath() may explicitly ignore the return value.

Signed-off-by: Mark Jonas <toertel@gmail.com>
---
 core/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Babic Dec. 24, 2020, 2:15 p.m. UTC | #1
Hi Mark,

On 24.12.20 14:23, Mark Jonas wrote:
> Recursive call of mkpath() may explicitly ignore the return value.
> 
> Signed-off-by: Mark Jonas <toertel@gmail.com>
> ---
>   core/util.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/core/util.c b/core/util.c
> index 7c0d417..7bc4c98 100644
> --- a/core/util.c
> +++ b/core/util.c
> @@ -276,7 +276,7 @@ int mkpath(char *dir, mode_t mode)
>   	if (strlen(dir) == 1 && dir[0] == '/')
>   		return 0;
>   
> -	mkpath(dirname(strdupa(dir)), mode);
> +	(void) mkpath(dirname(strdupa(dir)), mode);
>   
>   	if (mkdir(dir, mode) == -1) {
>   		if (errno != EEXIST)
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/core/util.c b/core/util.c
index 7c0d417..7bc4c98 100644
--- a/core/util.c
+++ b/core/util.c
@@ -276,7 +276,7 @@  int mkpath(char *dir, mode_t mode)
 	if (strlen(dir) == 1 && dir[0] == '/')
 		return 0;
 
-	mkpath(dirname(strdupa(dir)), mode);
+	(void) mkpath(dirname(strdupa(dir)), mode);
 
 	if (mkdir(dir, mode) == -1) {
 		if (errno != EEXIST)