dax: Move mandatory ->zero_page_range() check in alloc_dax()
[linux-2.6-microblaze.git] / drivers / dax / bus.c
index 46e4604..df238c8 100644 (file)
@@ -421,8 +421,10 @@ struct dev_dax *__devm_create_dev_dax(struct dax_region *dax_region, int id,
         * device outside of mmap of the resulting character device.
         */
        dax_dev = alloc_dax(dev_dax, NULL, NULL, DAXDEV_F_SYNC);
-       if (!dax_dev)
+       if (IS_ERR(dax_dev)) {
+               rc = PTR_ERR(dax_dev);
                goto err;
+       }
 
        /* a device_dax instance is dead while the driver is not attached */
        kill_dax(dax_dev);