Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1347915

[patch] sbp-target: checking for NULL instead of IS_ERR

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject [patch] sbp-target: checking for NULL instead of IS_ERR
Date Wed, 02 Mar 2016 11:10:05 +0100
Message-ID <r8bTe-6bA-37@gated-at.bofh.it> (permalink)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.24 (2015-08-30)
X-Source-IP aserv0022.oracle.com [141.146.126.234]
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 19
Organization linux.* mail to news gateway
X-Original-Cc target-devel@vger.kernel.org, linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
X-Original-Date Wed, 2 Mar 2016 13:09:12 +0300
X-Original-Message-ID <20160302100912.GD5533@mwanda>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1347915

Show key headers only | View raw


We changed this from kzalloc to sbp_mgt_get_req() so we need to change
from checking for NULL to check for error pointers.

Fixes: c064b2a78989 ('sbp-target: Conversion to percpu_ida tag pre-allocation')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
index 251d532..a04b0605f 100644
--- a/drivers/target/sbp/sbp_target.c
+++ b/drivers/target/sbp/sbp_target.c
@@ -951,7 +951,7 @@ static void tgt_agent_fetch_work(struct work_struct *work)
 
 	while (next_orb && tgt_agent_check_active(agent)) {
 		req = sbp_mgt_get_req(sess, sess->card, next_orb);
-		if (!req) {
+		if (IS_ERR(req)) {
 			spin_lock_bh(&agent->lock);
 			agent->state = AGENT_STATE_DEAD;
 			spin_unlock_bh(&agent->lock);

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[patch] sbp-target: checking for NULL instead of IS_ERR Dan Carpenter <dan.carpenter@oracle.com> - 2016-03-02 11:10 +0100

csiph-web