kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Karsten Graul <kgraul@linux.ibm.com>,
	Guvenc Gulce <guvenc@linux.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-s390@vger.kernel.org, netdev@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [PATCH net-next] net/smc: Fix ENODATA tests in smc_nl_get_fback_stats()
Date: Sat, 19 Jun 2021 16:50:21 +0300	[thread overview]
Message-ID: <YM32HV7psa+PrmbV@mwanda> (raw)

These functions return negative ENODATA but the minus sign was left out
in the tests.

Fixes: f0dd7bf5e330 ("net/smc: Add netlink support for SMC fallback statistics")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 net/smc/smc_stats.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/smc/smc_stats.c b/net/smc/smc_stats.c
index 614013e3b574..e80e34f7ac15 100644
--- a/net/smc/smc_stats.c
+++ b/net/smc/smc_stats.c
@@ -393,17 +393,17 @@ int smc_nl_get_fback_stats(struct sk_buff *skb, struct netlink_callback *cb)
 			continue;
 		if (!skip_serv) {
 			rc_srv = smc_nl_get_fback_details(skb, cb, k, is_srv);
-			if (rc_srv && rc_srv != ENODATA)
+			if (rc_srv && rc_srv != -ENODATA)
 				break;
 		} else {
 			skip_serv = 0;
 		}
 		rc_clnt = smc_nl_get_fback_details(skb, cb, k, !is_srv);
-		if (rc_clnt && rc_clnt != ENODATA) {
+		if (rc_clnt && rc_clnt != -ENODATA) {
 			skip_serv = 1;
 			break;
 		}
-		if (rc_clnt == ENODATA && rc_srv == ENODATA)
+		if (rc_clnt == -ENODATA && rc_srv == -ENODATA)
 			break;
 	}
 	mutex_unlock(&net->smc.mutex_fback_rsn);
-- 
2.30.2


             reply	other threads:[~2021-06-19 13:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-19 13:50 Dan Carpenter [this message]
2021-06-21 17:02 ` [PATCH net-next] net/smc: Fix ENODATA tests in smc_nl_get_fback_stats() Guvenc Gulce
2021-06-21 19:20 ` 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=YM32HV7psa+PrmbV@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=guvenc@linux.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.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).