From f974dee9b0713792a76ffd9ea3cf8cc2538544b2 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 17 Feb 2015 07:08:49 +0000 Subject: [PATCH] ib_srpt: Suppress a checkpath complaint Avoid that checkpatch reports the following: WARNING: Possible unnecessary 'out of memory' message git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6106 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index f7cfe0fec..d01724f2b 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -3693,24 +3693,20 @@ static int srpt_get_initiator_port_transport_id(struct scst_tgt *tgt, uint8_t i_port_id[16]; }; struct spc_rdma_transport_id *tr_id; - int res; + int res = SCSI_TRANSPORTID_PROTOCOLID_SRP; - if (!sess) { - res = SCSI_TRANSPORTID_PROTOCOLID_SRP; + if (!sess) goto out; - } ch = scst_sess_get_tgt_priv(sess); BUG_ON(!ch); BUILD_BUG_ON(sizeof(*tr_id) != 24); + res = -ENOMEM; tr_id = kzalloc(sizeof(struct spc_rdma_transport_id), GFP_KERNEL); - if (!tr_id) { - pr_err("Allocation of TransportID failed\n"); - res = -ENOMEM; + if (!tr_id) goto out; - } res = 0; tr_id->protocol_identifier = SCSI_TRANSPORTID_PROTOCOLID_SRP;