diff options
author | roel kluin <roel.kluin@gmail.com> | 2008-11-29 02:17:27 +0100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-12-03 11:04:02 +0100 |
commit | 2fd091f3eebc5accefa5f77ff04436982765d15c (patch) | |
tree | bb7f52a42dcf5d7291bf2a1b2ac51da52330529f /drivers | |
parent | of/i2c: Fill the archdata for I2C devices (diff) | |
download | linux-2fd091f3eebc5accefa5f77ff04436982765d15c.tar.xz linux-2fd091f3eebc5accefa5f77ff04436982765d15c.zip |
powerpc/macintosh: Fix unsigned check in smu_sat_get_sdb_partition()
i2c_smbus_read_word_data() returns a s32, which may be negative
but unsigned len cannot be negative.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/macintosh/windfarm_smu_sat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 7f2be4baaeda..7847e981ac33 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c @@ -87,11 +87,12 @@ struct smu_sdbp_header *smu_sat_get_sdb_partition(unsigned int sat_id, int id, return NULL; } - len = i2c_smbus_read_word_data(&sat->i2c, 9); - if (len < 0) { + err = i2c_smbus_read_word_data(&sat->i2c, 9); + if (err < 0) { printk(KERN_ERR "smu_sat_get_sdb_part rd len error\n"); return NULL; } + len = err; if (len == 0) { printk(KERN_ERR "smu_sat_get_sdb_part no partition %x\n", id); return NULL; |