Skip to content

Commit

Permalink
w1: fix for loop exit condition in w1_seq_show()
Browse files Browse the repository at this point in the history
The W1_42_FINISHED_BYTE is 0xFF so the cast means the condition is
never true.

Fixes: d9411e5 ('w1: Add support for DS28EA00 sequence to w1-therm')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Jun 12, 2015
1 parent fc368ea commit a14ef24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/w1/slaves/w1_therm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a14ef24

Please sign in to comment.