Re: [patch] staging: lustre: checking for NULL instead of IS_ERR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2016/03/17, 23:42, "Dan Carpenter" <dan.carpenter@xxxxxxxxxx> wrote:

>lustre_cfg_new() returns error pointers on error, it never returns NULL.
>
>Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
>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@xxxxxxxxx>


Cheers, Andreas
-- 
Andreas Dilger

Lustre Principal Architect
Intel High Performance Data Division


--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux