提交 72abaadf 编写于 作者: P Peter Senna Tschudin 提交者: 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: NPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: NGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册