All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Benny Halevy <bhalevy@panasas.com>,
	"James E.J. Bottomley" <James.Bottomley@suse.de>,
	osd-dev@open-osd.org, linux-scsi@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [patch] scsi/osd: checking NULL instead of ERR_PTR()
Date: Fri, 12 Nov 2010 04:31:46 +0000	[thread overview]
Message-ID: <20101112043146.GC3533@bicker> (raw)

bio_map_kern() returns ERR_PTRs on failure and never returns NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index 0433ea6..b798919 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
 	/* create a bio for continuation segment */
 	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
 			   GFP_KERNEL);
-	if (unlikely(!bio))
-		return -ENOMEM;
+	if (unlikely(IS_ERR(bio)))
+		return PTR_ERR(bio);
 
 	bio->bi_rw |= REQ_WRITE;
 

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Benny Halevy <bhalevy@panasas.com>,
	"James E.J. Bottomley" <James.Bottomley@suse.de>,
	osd-dev@open-osd.org, linux-scsi@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [patch] scsi/osd: checking NULL instead of ERR_PTR()
Date: Fri, 12 Nov 2010 07:31:46 +0300	[thread overview]
Message-ID: <20101112043146.GC3533@bicker> (raw)

bio_map_kern() returns ERR_PTRs on failure and never returns NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index 0433ea6..b798919 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
 	/* create a bio for continuation segment */
 	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
 			   GFP_KERNEL);
-	if (unlikely(!bio))
-		return -ENOMEM;
+	if (unlikely(IS_ERR(bio)))
+		return PTR_ERR(bio);
 
 	bio->bi_rw |= REQ_WRITE;
 

             reply	other threads:[~2010-11-12  4:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12  4:31 Dan Carpenter [this message]
2010-11-12  4:31 ` [patch] scsi/osd: checking NULL instead of ERR_PTR() Dan Carpenter
2010-11-14 13:39 ` Boaz Harrosh
2010-11-14 13:39   ` Boaz Harrosh
2010-11-21 10:31   ` Boaz Harrosh
2010-11-21 10:31     ` Boaz Harrosh
2010-11-30 10:22     ` Boaz Harrosh
2010-11-30 10:22       ` Boaz Harrosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101112043146.GC3533@bicker \
    --to=error27@gmail.com \
    --cc=James.Bottomley@suse.de \
    --cc=bhalevy@panasas.com \
    --cc=bharrosh@panasas.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=osd-dev@open-osd.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.