netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denis Kirjanov <kirjanov@gmail.com>
To: stephen@networkplumber.org, dsahern@kernel.org
Cc: netdev@vger.kernel.org, Denis Kirjanov <dkirjanov@suse.de>
Subject: [PATCH iproute2] ifstat: don't set errno if strdup fails
Date: Mon, 18 Mar 2024 05:16:40 -0400	[thread overview]
Message-ID: <20240318091640.2672-1-dkirjanov@suse.de> (raw)

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(-)

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;
 	}
 
-- 
2.30.2


             reply	other threads:[~2024-03-18  9:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18  9:16 Denis Kirjanov [this message]
2024-03-20  4:30 ` [PATCH iproute2] ifstat: don't set errno if strdup fails patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240318091640.2672-1-dkirjanov@suse.de \
    --to=kirjanov@gmail.com \
    --cc=dkirjanov@suse.de \
    --cc=dsahern@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).