From: Jani Nikula Date: Tue, 23 Mar 2010 20:35:27 +0000 (-0700) Subject: c2port: fix device_create() return value check X-Git-Tag: v2.6.34-rc3~64 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=8c363afe94b885d39ae2e93e41680282a470ad84;p=~emulex%2Finfiniband.git c2port: fix device_create() return value check Use IS_ERR() instead of comparing to NULL. [akpm@linux-foundation.org: preserve the error code] Signed-off-by: Jani Nikula Cc: Vegard Nossum Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c index b5346b4db91..b7a85f46a6c 100644 --- a/drivers/misc/c2port/core.c +++ b/drivers/misc/c2port/core.c @@ -912,8 +912,8 @@ struct c2port_device *c2port_device_register(char *name, c2dev->dev = device_create(c2port_class, NULL, 0, c2dev, "c2port%d", id); - if (unlikely(!c2dev->dev)) { - ret = -ENOMEM; + if (unlikely(IS_ERR(c2dev->dev))) { + ret = PTR_ERR(c2dev->dev); goto error_device_create; } dev_set_drvdata(c2dev->dev, c2dev);