diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2012-09-18 14:07:58 +0200 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-09-22 23:41:52 +0200 |
commit | 7c4c72f4438e3e99ad39b2a86e477fb1c6fd1f3f (patch) | |
tree | cf92b44daea44c107d4bbcc2bb3079b39c0d723a /drivers/video/cyber2000fb.c | |
parent | drivers/video/bw2.c: fix error return code (diff) | |
download | linux-7c4c72f4438e3e99ad39b2a86e477fb1c6fd1f3f.tar.xz linux-7c4c72f4438e3e99ad39b2a86e477fb1c6fd1f3f.zip |
drivers/video/cyber2000fb.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: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/cyber2000fb.c')
-rw-r--r-- | drivers/video/cyber2000fb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index c1527f5b47ee..e40125cb313e 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c @@ -1804,8 +1804,10 @@ cyberpro_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) cfb->irq = dev->irq; cfb->region = pci_ioremap_bar(dev, 0); - if (!cfb->region) + if (!cfb->region) { + err = -ENOMEM; goto failed_ioremap; + } cfb->regs = cfb->region + MMIO_OFFSET; cfb->fb.device = &dev->dev; |