From: "Nicholas A. Bellinger" Date: Thu, 15 Mar 2012 23:13:05 +0000 Subject: Re: [patch] tcm_qla2xxx: checking for NULL instead of IS_ERR() Message-Id: <1331853185.10203.129.camel@haakon2.linux-iscsi.org> List-Id: References: <20120313172119.GE31808@elgon.mountain> In-Reply-To: <20120313172119.GE31808@elgon.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: Andrew Vasquez , linux-driver@qlogic.com, "James E.J. Bottomley" , linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org On Tue, 2012-03-13 at 20:21 +0300, Dan Carpenter wrote: > target_fabric_configfs_init() never returns NULLs, only ERR_PTRs. > > Signed-off-by: Dan Carpenter > > diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > index dcbcedc..08cf507 100644 > --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c > +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c > @@ -1885,9 +1885,9 @@ static int tcm_qla2xxx_register_configfs(void) > * Register the top level struct config_item_type for NPIV with TCM core > */ > npiv_fabric = target_fabric_configfs_init(THIS_MODULE, "qla2xxx_npiv"); > - if (!npiv_fabric) { > + if (IS_ERR(npiv_fabric)) { > pr_err("target_fabric_configfs_init() failed\n"); > - ret = -ENOMEM; > + ret = PTR_ERR(npiv_fabric); > goto out_fabric; > } > /* Doh, missed this fix for the qla2xxx_npiv fabric_ops allocation.. Applied to lio-core and will get fixed up for-next-merge. Thanks Dan! --nab