public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: frank.blaschka@de•ibm.com
To: davem@davemloft•net
Cc: netdev@vger•kernel.org, linux-s390@vger•kernel.org,
	Peter Senna Tschudin <peter.senna@gmail•com>,
	Ursula Braun <ursula.braun@de•ibm.com>
Subject: [patch 5/5] [PATCH] ctcm: fix error return code
Date: Mon, 24 Sep 2012 16:24:27 +0200	[thread overview]
Message-ID: <20120924142501.449097699@de.ibm.com> (raw)
In-Reply-To: 20120924142422.001953152@de.ibm.com

[-- Attachment #1: 604-ctcm-return-code.diff --]
[-- Type: text/plain, Size: 1154 bytes --]

From: Peter Senna Tschudin <peter.senna@gmail•com>

Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail•com>
Signed-off-by: Ursula Braun <ursula.braun@de•ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de•ibm.com>
---
 drivers/s390/net/ctcm_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index 5227e57..98ea9cc 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -1454,7 +1454,7 @@ static int add_channel(struct ccw_device *cdev, enum ctcm_channel_types type,
 				ch_fsm_len, GFP_KERNEL);
 	}
 	if (ch->fsm == NULL)
-				goto free_return;
+				goto nomem_return;
 
 	fsm_newstate(ch->fsm, CTC_STATE_IDLE);
 
-- 
1.7.11.7

  parent reply	other threads:[~2012-09-24 14:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 14:24 [patch 0/5] s390: network patches for net-next frank.blaschka
2012-09-24 14:24 ` [patch 1/5] [PATCH] qeth: cleanup channel path descriptor function frank.blaschka
2012-09-24 14:24 ` [patch 2/5] [PATCH] lcs: ensure proper ccw setup frank.blaschka
2012-09-24 14:24 ` [patch 3/5] [PATCH] qeth: fix possible memory leak in qeth_l3_add_[vipa|rxip]() frank.blaschka
2012-09-24 14:24 ` [patch 4/5] [PATCH] drivers/s390/net: removes unnecessary semicolon frank.blaschka
2012-09-24 14:24 ` frank.blaschka [this message]
2012-09-24 19:47 ` [patch 0/5] s390: network patches for net-next David Miller

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=20120924142501.449097699@de.ibm.com \
    --to=frank.blaschka@de$(echo .)ibm.com \
    --cc=davem@davemloft$(echo .)net \
    --cc=linux-s390@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=peter.senna@gmail$(echo .)com \
    --cc=ursula.braun@de$(echo .)ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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