diff mbox series

[iproute2] ifstat: don't set errno if strdup fails

Message ID 20240318091640.2672-1-dkirjanov@suse.de (mailing list archive)
State Accepted
Commit 4da7bfbf917bacfe19974634de0006be24f0b89f
Delegated to: Stephen Hemminger
Headers show
Series [iproute2] ifstat: don't set errno if strdup fails | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Denis Kirjanov March 18, 2024, 9:16 a.m. UTC
the strdup man page states that the errno value
set by the function so there is not need to set it.

Signed-off-by: Denis Kirjanov <dkirjanov@suse.de>
---
 misc/ifstat.c | 1 -
 1 file changed, 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 20, 2024, 4:30 a.m. UTC | #1
Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

On Mon, 18 Mar 2024 05:16:40 -0400 you wrote:
> the strdup man page states that the errno value
> set by the function so there is not need to set it.
> 
> Signed-off-by: Denis Kirjanov <dkirjanov@suse.de>
> ---
>  misc/ifstat.c | 1 -
>  1 file changed, 1 deletion(-)

Here is the summary with links:
  - [iproute2] ifstat: don't set errno if strdup fails
    https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=4da7bfbf917b

You are awesome, thank you!
diff mbox series

Patch

diff --git a/misc/ifstat.c b/misc/ifstat.c
index 352e5622..9b93ded3 100644
--- a/misc/ifstat.c
+++ b/misc/ifstat.c
@@ -197,7 +197,6 @@  static int get_nlmsg(struct nlmsghdr *m, void *arg)
 	n->name = strdup(RTA_DATA(tb[IFLA_IFNAME]));
 	if (!n->name) {
 		free(n);
-		errno = ENOMEM;
 		return -1;
 	}