All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: James Smart <james.smart@avagotech.com>,
	Dick Kennedy <dick.kennedy@avagotech.com>,
	James Bottomley <JBottomley@Odin.com>,
	Jiri Slaby <jslaby@suse.cz>
Subject: [patch added to the 3.12 stable tree] lpfc: Fix scsi prep dma buf error.
Date: Mon, 14 Sep 2015 16:31:02 +0200	[thread overview]
Message-ID: <1442241067-32390-3-git-send-email-jslaby@suse.cz> (raw)
In-Reply-To: <1442241067-32390-1-git-send-email-jslaby@suse.cz>

From: James Smart <james.smart@avagotech.com>

This patch has been added to the 3.12 stable tree. If you have any
objections, please let us know.

===============

commit 5116fbf136ea21b8678a85eee5c03508736ada9f upstream.

Didn't check for less-than-or-equal zero. Means we may later call
scsi_dma_unmap() even though we don't have valid mappings.

Signed-off-by: Dick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/scsi/lpfc/lpfc_scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index c913e8cc3b26..ed7759980c47 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -3423,7 +3423,7 @@ lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_scsi_buf *lpfc_cmd)
 		 */
 
 		nseg = scsi_dma_map(scsi_cmnd);
-		if (unlikely(!nseg))
+		if (unlikely(nseg <= 0))
 			return 1;
 		sgl += 1;
 		/* clear the last flag in the fcp_rsp map entry */
-- 
2.5.2


  parent reply	other threads:[~2015-09-14 14:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14 14:31 [patch added to the 3.12 stable tree] mtip32xx: dynamically allocate buffer in debugfs functions Jiri Slaby
2015-09-14 14:31 ` [patch added to the 3.12 stable tree] cifs: Send a logoff request before removing a smb session Jiri Slaby
2015-09-14 14:31 ` Jiri Slaby [this message]
2015-09-14 14:31 ` [patch added to the 3.12 stable tree] bio: fix argument of __bio_add_page() for max_sectors > 0xffff Jiri Slaby
2015-09-14 14:31 ` [patch added to the 3.12 stable tree] dm cache mq: fix memory allocation failure for large cache devices Jiri Slaby
2015-09-14 14:31 ` [patch added to the 3.12 stable tree] aio: fix reqs_available handling Jiri Slaby
2015-09-14 14:31 ` [patch added to the 3.12 stable tree] netfilter: nf_conntrack: fix RCU race in nf_conntrack_find_get Jiri Slaby
2015-09-14 14:31 ` [patch added to the 3.12 stable tree] netfilter: nf_conntrack: don't release a conntrack with non-zero refcnt Jiri Slaby

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=1442241067-32390-3-git-send-email-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=JBottomley@Odin.com \
    --cc=dick.kennedy@avagotech.com \
    --cc=james.smart@avagotech.com \
    --cc=stable@vger.kernel.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.