[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20150601095537.GA897@mwanda>
Date: Mon, 1 Jun 2015 12:55:37 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Evgeniy Polyakov <zbr@...emap.net>,
Matt Campbell <mattrcampbell@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
David Fries <David@...es.net>, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch 1/2] w1: fix for loop exit condition in w1_seq_show()
The W1_42_FINISHED_BYTE is 0xFF so the cast means the condition is
never true.
Fixes: d9411e57dc7f ('w1: Add support for DS28EA00 sequence to w1-therm')
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index d21e686..3351be6 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -378,7 +378,7 @@ static ssize_t w1_seq_show(struct device *device,
w1_write_8(sl->master, W1_42_COND_READ);
rv = w1_read_block(sl->master, (u8 *)&rn, 8);
reg_num = (struct w1_reg_num *) &rn;
- if ((char)reg_num->family == W1_42_FINISHED_BYTE)
+ if (reg_num->family == W1_42_FINISHED_BYTE)
break;
if (sl->reg_num.id == reg_num->id)
seq = i;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists