staging/lustre/llog: fix return value of llog_alloc_handle
authorLi Xi <pkuelelixi@gmail.com>
Thu, 14 Nov 2013 16:13:17 +0000 (00:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Nov 2013 04:23:04 +0000 (13:23 +0900)
llog_open() calls llog_alloc_handle() taking NULL as the error return
value. But llog_alloc_handle() returns ERR_PTR(-ENOMEM) instead when
error.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3470
Lustre-change: http://review.whamcloud.com/6644
Signed-off-by: Li Xi <pkuelelixi@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/obdclass/llog.c

index 0cb44287502b712ebe6ab6a9258790408deb4b3d..b4dad344b72a857a21ceda8efdfe673a854ad9c6 100644 (file)
@@ -62,7 +62,7 @@ struct llog_handle *llog_alloc_handle(void)
 
        OBD_ALLOC_PTR(loghandle);
        if (loghandle == NULL)
-               return ERR_PTR(-ENOMEM);
+               return NULL;
 
        init_rwsem(&loghandle->lgh_lock);
        spin_lock_init(&loghandle->lgh_hdr_lock);