env: fix memory leak in fw_env routines
[oweals/u-boot.git] / include / linux / err.h
index 5b3c8bcf700af26f88812491f0bf52b8a00537fa..22e5756eddc25865fc594c12c979319b16d68829 100644 (file)
@@ -4,7 +4,7 @@
 #include <linux/compiler.h>
 #include <linux/compat.h>
 
-#include <asm/errno.h>
+#include <linux/errno.h>
 
 
 /*
@@ -36,6 +36,11 @@ static inline long IS_ERR(const void *ptr)
        return IS_ERR_VALUE((unsigned long)ptr);
 }
 
+static inline bool IS_ERR_OR_NULL(const void *ptr)
+{
+       return !ptr || IS_ERR_VALUE((unsigned long)ptr);
+}
+
 /**
  * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type
  * @ptr: The pointer to cast.