diff options
Diffstat (limited to 'include/linux/err.h')
-rw-r--r-- | include/linux/err.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/err.h b/include/linux/err.h index e4d22d508c..22e5756edd 100644 --- a/include/linux/err.h +++ b/include/linux/err.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. |