[patch] staging: lustre: checking for NULL instead of IS_ERR
Dilger, Andreas
andreas.dilger at intel.com
Fri Mar 18 19:28:15 UTC 2016
On 2016/03/17, 23:42, "Dan Carpenter" <dan.carpenter at oracle.com> wrote:
>lustre_cfg_new() returns error pointers on error, it never returns NULL.
>
>Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com>
>
>diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c
>b/drivers/staging/lustre/lustre/mgc/mgc_request.c
>index 65caffe..b7dc872 100644
>--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
>+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
>@@ -1282,7 +1282,7 @@ static int mgc_apply_recover_logs(struct obd_device
>*mgc,
>
> rc = -ENOMEM;
> lcfg = lustre_cfg_new(LCFG_PARAM, &bufs);
>- if (!lcfg) {
>+ if (IS_ERR(lcfg)) {
> CERROR("mgc: cannot allocate memory\n");
> break;
> }
Looks good. Thanks for the patch.
Reviewed-by: Andreas Dilger <andreas.dilger at intel.com>
Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel High Performance Data Division
More information about the devel
mailing list