dax: alloc_dax() return ERR_PTR(-EOPNOTSUPP) for CONFIG_DAX=n
[sfrench/cifs-2.6.git] / drivers / dax / super.c
index f4b635526345adcffb2bf3031c35a464599fef1d..97ef2a9d878d12e8f1ea9e61d629e1af0b7d3e0c 100644 (file)
@@ -319,6 +319,11 @@ EXPORT_SYMBOL_GPL(dax_alive);
  * that any fault handlers or operations that might have seen
  * dax_alive(), have completed.  Any operations that start after
  * synchronize_srcu() has run will abort upon seeing !dax_alive().
+ *
+ * Note, because alloc_dax() returns an ERR_PTR() on error, callers
+ * typically store its result into a local variable in order to check
+ * the result. Therefore, care must be taken to populate the struct
+ * device dax_dev field make sure the dax_dev is not leaked.
  */
 void kill_dax(struct dax_device *dax_dev)
 {