public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] target/transport: Silence unitialized variable warnings
@ 2016-04-14  9:32 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-04-14  9:32 UTC (permalink / raw)
  To: Nicholas A. Bellinger, Bart Van Assche
  Cc: Ray Jui, Scott Branden, Jon Mason, target-devel, linux-kernel,
	kernel-janitors

The core_scsi3_ua_for_check_condition() can return without initializing
these variables.  I have initialized them to zero so that it triggers a
WARN_ON_ONCE() in that situation.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index ab2bf12..851e634 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2884,7 +2884,8 @@ static int translate_sense_reason(struct se_cmd *cmd, sense_reason_t reason)
 	const struct sense_info *si;
 	u8 *buffer = cmd->sense_buffer;
 	int r = (__force int)reason;
-	u8 asc, ascq;
+	u8 asc = 0;
+	u8 ascq = 0;
 	bool desc_format = target_sense_desc_format(cmd->se_dev);
 
 	if (r < ARRAY_SIZE(sense_info_table) && sense_info_table[r].key)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-14  9:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-14  9:32 [patch] target/transport: Silence unitialized variable warnings Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox