linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Christoph Hellwig <hch@lst.de>,
	"Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH] target: initialize sense_reason_t ret in core_scsi3_emulate_pro_register()
Date: Sat, 22 Dec 2012 22:15:57 +0100	[thread overview]
Message-ID: <1356210957-30089-1-git-send-email-geert@linux-m68k.org> (raw)
In-Reply-To: <y>

drivers/target/target_core_pr.c: In function ‘core_scsi3_emulate_pro_register’:
drivers/target/target_core_pr.c:2056: warning: ‘ret’ may be used uninitialized in this function

If !spec_i_pt, the "goto out_put_pr_reg" on line 2141 seems to be a real
case where ret is not initialized.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/target/target_core_pr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index e35dbf8..c2e8026 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -2053,7 +2053,7 @@ core_scsi3_emulate_pro_register(struct se_cmd *cmd, u64 res_key, u64 sa_res_key,
 	/* Used for APTPL metadata w/ UNREGISTER */
 	unsigned char *pr_aptpl_buf = NULL;
 	unsigned char isid_buf[PR_REG_ISID_LEN], *isid_ptr = NULL;
-	sense_reason_t ret;
+	sense_reason_t ret = 0;
 	int pr_holder = 0, type;
 
 	if (!se_sess || !se_lun) {
-- 
1.7.0.4

             reply	other threads:[~2012-12-22 21:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-22 21:15 Geert Uytterhoeven [this message]
2013-01-09  1:51 ` [PATCH] target: initialize sense_reason_t ret in core_scsi3_emulate_pro_register() Nicholas A. Bellinger

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=1356210957-30089-1-git-send-email-geert@linux-m68k.org \
    --to=geert@linux-m68k.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=target-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).