On Tue, 2015-05-19 at 15:05 +0300, Dan Carpenter wrote: > core_tpg_alloc_lun() returns ERR_PTRs, it never returns NULL. > > Fixes: b865ae297e42 ('target: Convert se_portal_group->tpg_lun_list[] to RCU hlist') > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> > > diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c > index a0e2946..9be8030 100644 > --- a/drivers/target/target_core_fabric_configfs.c > +++ b/drivers/target/target_core_fabric_configfs.c > @@ -898,8 +898,8 @@ static struct config_group *target_fabric_make_lun( > return ERR_PTR(-EINVAL); > > lun = core_tpg_alloc_lun(se_tpg, unpacked_lun); > - if (!lun) > - return ERR_PTR(-ENOMEM); > + if (IS_ERR(lun)) > + return ERR_CAST(lun); > > lun_cg = &lun->lun_group; > lun_cg->default_groups = kmalloc(sizeof(struct config_group *) * 2, > -- Applied to for-next, and will squash into the original commit soon. Thanks Dan! --nab -- 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