ctcm: fix error return code
authorPeter Senna Tschudin <peter.senna@gmail.com>
Mon, 24 Sep 2012 04:24:27 +0000 (04:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Sep 2012 19:45:18 +0000 (15:45 -0400)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/ctcm_main.c

index 5227e5734a9d152e45a2b4920a13f92b7354051e..98ea9cc6f1aaba9f442ecb4b46724c0f3f5ccd7b 100644 (file)
@@ -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);