Commit 72abaadf authored by Peter Senna Tschudin's avatar Peter Senna Tschudin Committed by Martin Schwidefsky

drivers/s390/char/monreader.c: fix error return code

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: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent b1d6b40c
...@@ -571,8 +571,11 @@ static int __init mon_init(void) ...@@ -571,8 +571,11 @@ static int __init mon_init(void)
if (rc) if (rc)
goto out_iucv; goto out_iucv;
monreader_device = kzalloc(sizeof(struct device), GFP_KERNEL); monreader_device = kzalloc(sizeof(struct device), GFP_KERNEL);
if (!monreader_device) if (!monreader_device) {
rc = -ENOMEM;
goto out_driver; goto out_driver;
}
dev_set_name(monreader_device, "monreader-dev"); dev_set_name(monreader_device, "monreader-dev");
monreader_device->bus = &iucv_bus; monreader_device->bus = &iucv_bus;
monreader_device->parent = iucv_root; monreader_device->parent = iucv_root;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment