diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 8f1d6569564c..2b9e41377a07 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -409,13 +409,11 @@ __cpu_device_create(struct device *parent, void *drvdata, const char *fmt, va_list args) { struct device *dev = NULL; - int retval = -ENODEV; + int retval = -ENOMEM; dev = kzalloc(sizeof(*dev), GFP_KERNEL); - if (!dev) { - retval = -ENOMEM; + if (!dev) goto error; - } device_initialize(dev); dev->parent = parent;